Is listing page?

This topic contains 3 replies, has 2 voices, and was last updated by  Paolo 8 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #278576

    EH
    Expired Member
    Post count: 96

    I made a custom menu to navigate the listing category since this is a lot I’m doing as a dropdown. You can see it here:
    https://techdecisions.co/location/

    I want this to show up on location, place and search but not listing pages such as this one:
    https://techdecisions.co/places/united-states/massachusetts/framingham/listing-security/eh-media/

    Here is how I’m placing the menu in functions.php

    
    
            //Add Category Menu 
            add_action('genesis_after_header', 'add_fifth_menu');
            function add_fifth_menu (){
                if(geodir_is_geodir_page() && (strpos($_SERVER['REQUEST_URI'], "location") !== false) ) {
                    wp_nav_menu( array( 
                    'theme_location' => 'fifth', 
                    'container_class' => 'menu-directory-container' ) );
                }
                elseif ( (strpos($_SERVER['REQUEST_URI'], "places") == true)) {
                    wp_nav_menu( array( 
                    'theme_location' => 'fifth', 
                    'container_class' => 'menu-directory-container' ) );   
                }
              
                elseif  ( (strpos($_SERVER['REQUEST_URI'], "geodir_search") == true)) {
                    wp_nav_menu( array( 
                    'theme_location' => 'fifth', 
                    'container_class' => 'menu-directory-container' ) );
                }
            }

    So it’s doing it as I told it because places is in the url for a listing. Is there a way to as and not listing page?

    #278690

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    you can use geodir_is_page(‘listing’).

    See: https://wpgeodirectory.com/codex/codex/geodirectory_functions/geodir_is_page/

    Let us know how it goes.

    Thanks

    #279143

    EH
    Expired Member
    Post count: 96

    This worked thank you!

    #279180

    Paolo
    Site Admin
    Post count: 31206

    You are welcome 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount