• Resolved KOKOStern

    (@kokostern)


    I just put up a new category of posts and wanted to add a link to it in my main menu.

    I did so and noticed I have a new empty post on my front page. I deleted it and found out my new menu navigation item is gone.

    For some reason menu navigation items show up as posts on the front page.

Viewing 7 replies - 16 through 22 (of 22 total)
  • Can you send me your child theme’s function.php?
    Also, can you add this code to your site and copy and paste the result here?

    <?php
    echo "<pre>"; print_r($wp_query->query_vars); echo "</pre>";
    ?>

    if you add it in the header.php file just under <div class=”site-branding”>, it looks really nice.

    Thread Starter KOKOStern

    (@kokostern)

    Sent you an e-mail with all that info.

    Thank you very much. It seems like the old function (from Decode 2.9) is still being used here because the page, attachment, revision, and nav_menu_item post types are all being displayed.
    So are you replacing the theme with the build I sent you or are you adding it to your child theme? I’ve updated the function a little bit to make it more robust, but the information you sent me makes me think that there is more to the story. If you want, you can replace the function “add_post_types_to_query” in your functions.php with

    function add_post_types_to_query( $query ) {
    		$typelist = 'post';
    		if ( get_theme_mod( 'add_custom_post_types', '' ) !== '' ) {
    			$typelist .= ', ' . get_theme_mod( 'add_custom_post_types', '' );
    			$typelist = explode( ", ", $typelist );
    		}
    	if ( is_home() && $query->is_main_query() )
    		$query->set( 'post_type', $typelist );
    	return $query;
    }

    it starts on line 239 for me.

    Thread Starter KOKOStern

    (@kokostern)

    I was just using your build as a brand new theme (I went in style.css and changed the name so it’ll display differently).

    I actually didn’t think about it too much, but the post type should still exist without my function, as I’m using a plugin to create the CPT and I have the function just to be able to add the YARPP variable so YARPP detects the post type.

    Ok so I just tried it and changed the function on 2.9.1 and it finally shows my videos and no navigation items in sight. We got a solution.

    Thank you!!!

    Now you just gotta fix the invisible current menu item, release and everything will be perfect! Woo!

    Great! I’ve already added the invisible current menu item to 2.9.1. I’m adding a few more social icons and I can hopefully (finally!) release. I am trying to have a really perfect release.

    Thread Starter KOKOStern

    (@kokostern)

    I suggest once it’s really stable you put that down as the stable version so people know what to revert to in case of trouble, and then you can do whatever experiments you want with new releases, beta new stuff that is. ??

    Yep. I think 2.9 wasn’t completely ready in hindsight, but I was feeling pressure and getting lots of emails to release a new menu system.

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Menu Navigation appear on front page’ is closed to new replies.