How to get the menu to show on Blank page template

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3736 Reply
    Al
    Guest

    I am new to wordpress and find your theme quite flexible. I would like to get the menu to show on the Blank page template. How could this be done?

    #3737
    Ron
    Keymaster

    I would like to get the menu to show on the Blank page template. How could this be done?

    The blank page template is intended for creating and styling your own pages. You have to know HTML! Otherwise that template would not be of use to you.

    As for adding the menu, there is no easy way to do it. You can either copy the entire HTML structure on a normal page (view source). OR create your own sort of menu by adding links then styling it.

    Out of curiosity, why would you use the Blank Page template? Maybe there is another way to accomplish what you want.

    #3741
    Al
    Guest

    Thanks Ron. I was thinking of getting some nice graphics for a home landing page so did not want the header appearing on that particular page. when I tried uploading a sample graphic the blank page fit the bill except for being able to navigate to other pages. I see where you are coming from with your recommendations above but it was so great finding your theme with the flexibility of showing a page without the header I was curious to know if I would be able to complete the functionality of the page without getting into too much coding.
    So are you saying if I can get the code to provide the functionality I want I could insert that into the page and be good and ready to go?

    #3745
    Ron
    Keymaster

    Before anything else, the next update of the theme has some changes particularly on the menu. You might want to get the latest version now before it goes live on wordpress.org. You can get it here https://ronangelo.com/frontier/

    There are 2 ways to add your menu on the Blank Page.

    Option 1 Just copy the html structure of the menu then paste it on the editor. This means you would have to update the page separately if you update the menu.

    – Go to any page with the menu. Right-click then select “View Page Source”
    – Copy from <nav id=”nav-main”> up to </nav>
    – Then paste that on top of your page’s content on the editor.

    Option 2 Add a piece of code on the functions.php. You must be using a child-theme. With this, you won’t have to update the page separately if you update the menu. On your child theme add this code. Replace ‘2’ on ‘is_page(2)’ with your specific page’s ID.

    function blank_page_add_menu( $content ) {
    	if ( is_page(2) ) {
    		$my_menu = '<nav id="nav-main">';
    		$my_menu .= wp_nav_menu( array(
    			'echo' => '0',
    			'theme_location' => 'frontier-menu-primary',
    			'container' => false,
    			'menu_class' => 'nav-main',
    			'fallback_cb' => 'wp_page_menu')
    			);
    		$my_menu .= '</nav>';
    		$content = $my_menu . $content;
    	}
    	return $content;
    }
    add_filter( 'the_content', 'blank_page_add_menu' );
    #3759
    Al
    Guest

    Thanks again Ron this was really helpful. Could you confirm that the best way to update the theme is to ftp the contents of the zip file to the frontier folder in my themes directory?

    #3761
    Ron
    Keymaster

    Could you confirm that the best way to update the theme is to ftp the contents of the zip file to the frontier folder in my themes directory?

    That could work too.

    Here’s how I would do it.
    – Temporarily change to another theme so that Frontier is not active.
    – Delete the old version of Frontier (you haven’t edited any files, right?).
    – Click the “Install Themes” tab then choose “Upload”.
    – Select and upload the zip file.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: How to get the menu to show on Blank page template
Your information: