• Greetings WordPress Community,

    I’m looking to alter the way in which my Menu operates. You can view what I am trying to achieve at: https://cleaning.greenchoicegroup.com

    I’m trying to have my menu system display Home Page only on any Sub Pages that I’ve created. In the link above, you can see that there is no “Home Page” on the front, yet I wish there to be on any of the sub-pages I create within that site.

    The purpose of this is to have a Home Page link on any sub-pages allowing them to return to the Home Page, without it displaying on the Home Page, causing confusion.

    Here is the code that handles my menu system.

    <div id="menu" class="alignleft">
                                    <?php if( function_exists('wp_nav_menu') && has_nav_menu('primary'))
                                        {
                                                    wp_nav_menu( array('menu_id'=> '','container'=>''));
                                        }
                                               else {
                                                    echo '<ul>';
                                                            wp_list_pages('title_li=');
                                                    echo '</ul>';
                                               }
                                        ?>
    			</div>
Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter Alec Weekes

    (@alec-weekes)

    It still doesn’t show Home on the Home Page. I’ll try it with a is_page(‘ ‘)

    Vee

    (@vishalgularia)

    You want to show home link on home page menu?

    Thread Starter Alec Weekes

    (@alec-weekes)

    Neither of the functions is_page(‘2’) or is_front_page() are working.

    This is very odd, it is almost as if it is completely ignoring the line of code : /

    Thread Starter Alec Weekes

    (@alec-weekes)

    Basically, I am running a Mutlisite Network for a Client.

    They wish for me to remove the Home Page link displayed on any of the Home Pages, and have it present only on the child pages.

    So for example: Home Page | Services | Contact Us is how the menu looks now, but we only want the Home Page link to show on the child pages, not the Home Page of the site.

    Vee

    (@vishalgularia)

    Try, bloginfo(‘wpurl’)

    or can you give me the site link for check

    Thread Starter Alec Weekes

    (@alec-weekes)

    Sure.

    I’m trialing it on the Restaurant Mini-Site at the moment, you can view other pages to see what we’ve got, compared to what we want to achieve.

    https://cleaning.greenchoicegroup.com/restaurant-cleaning/

    Thread Starter Alec Weekes

    (@alec-weekes)

    I’m starting to believe that the echo is trying to call the entire line, and so repeating another link within an echo is causing issues.

    As seen in the original image I posted, Home is coloured to indicate it is part of a function, rather then just text.

    Update: To get the Home Page to show up, I need to change to code and remove the ” “. It looks like: echo <li><a href="bloginfo('wpurl')">Home</a></li>;

    However doing so throws up the error I posted earlier, regarding the Parse Error.

    Thread Starter Alec Weekes

    (@alec-weekes)

    Some research indicates the use of HTML hyperlinks in Php is not an easy task. Using ” or ‘ closes or starts new sections within Php (as we know), so by including a Hyperlink we close and reopen the Php command.

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘Menu Customisation – Urgent’ is closed to new replies.