Default WordPress navigation for single page theme - php

I have found a similar question here: Single Page Navigation Menu Dynamically Generated but I am not too sure how or even if this will work with what I am doing.
I am building a single page theme, in which every time the user creates a new page a new <section id="page-title"></section> is created and filled with the supplied content. I have all that working fine, but I am trying to use WordPress's default navigation. As in when a user creates a new page, it automatically gets added to the nav menu. Right now I have that working of course, but the links point to the page permalinks which I do not want. I need the page to point to a url like '/#page-title'
How can I adjust the wordpress wp_nav_menu(); function to display the # hashtag and the page title for the navigation instead of the permalink?

Related

Why when I create a page it displays in navigation menu on wordpress?

I have multiple pages on my wordpress website, I am creating a custom wordpress theme.
The problem is, when I create a page it automaticly adds to my menu (navigation bar) at the top of the page.
I want to create a page, then make a link to that page, but instead when a page is created, it add's to top of the navigation.
How can I solve this problem?
P.S I did not toggle "Automatically add new top-level pages to this menu"

WordPress: Adding home page (=latest posts page) to navigation properly

I have a WordPress template displaying the latest posts on the home page (www.mydomain.bla) as it is the default setting in WordPress:
Now, I want to add a link referring to my home page in my navigation (with Appearance -> Menus). The only way I found to do this is by adding a custom link referring to my domain.
Here's my problem:
Even though the link itself does the job, one thing is not working. When navigating to a single post (like www.mydomain.bla/a-single-post) the needed classes indicating the parent link (current-post-ancestor current-menu-parent current-post-parent) do not appear to a custom link like they would to if I had a "Post page" which is not the Homepage.
Is there a way to add a link referring to my posts-showing homepage properly?
Thanks a lot for your help!
Create a new template named "Our blog" and paste the code for posts in this template. Now add a new page named "HOME", select OUR BLOG template and publish the page. Now go to the reading section under the setting tab and change the setting from your latest posts to a single page and select your HOME page.
Now you can add page rather than adding a custom link in the menu.

Wordpress displaying php blog page

I know you can create a static front page using the wordpress dashboard; however, I would like to create my custom static front page just by coding the index.php page how I like and then providing a link to the blog.
I tried doing this by linking to blog.php. However I just get met with a blank page that just contains html and body tags. Is there a way to create a static front page site and just link to the blog without using the dashboard?
I don't like how using the dashboard to create a page automatically puts a heading tag on your page. Also, I don't know how to link to just the blog page without including links to all the other pages using <?php wp_list_pages( '&title_li=' ); ?>

PHP: Wordpress Test Page

The problem!
I have a Wordpress site up and running. I wanted to add a custom page, for example if I browse to site.com/mytest it would display just Hello world without any css etc.
What I've tried
I added a mytest.php file under var/www/wp-content/ and tried to browse to it. (The code simply echo a static text).
What I got was simply a 404 page by Wordpress.
To view the file you uploaded, browse: site.com/wp-content/mytest.php
If you just type site.com/mytest , wordpress will thin you are reffering to a page stored in the wp-database. Since it's not you cant view it.
To add the page in the menu, use custom menu and add as "Custom link".
You can make your page a wp custom page template by adding this at the top:
/*
Template Name:Your Page Name
*/
Then create a page in the wordpress dashboard pages and select your page template from the page template dropdown.

WordPress Genisis Featured page widget with an iframe

I have a clients website that uses a WordPress Genisis Framework Child Theme.
One of the widgets that are built into the theme is a featured page widget. It is placed on the front of the page. The widget gathers 250 characters and displays that on the front page along with the featured image from that page.
The problem is that because the next page only contains an iframe from another website the WordPress widget does not grab the text, so it leaves a nice blank hole on the clients homepage. The previous developer set it up this way and didn't bother to plug the hole.
Any ideas how I could get the text to display correctly.
I am familiar with most web languages and the WordPress back end so any suggestions would help.
You can try to place a hidden div on the page where you paste in the text that you want. It wont be dynamic if the integrated page changes but it could be a possible work around.

Categories