WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Trying to find id of main home page for directory

[Resolved] Trying to find id of main home page for directory

  • kevin heath
    Participant

    @ypraise

    Hi

    I’m trying to install a slider for the directory paort of my website.

    I only want to display the slider on the main page and I’m trying to find the right hook for a conditional on mu holidat sirectory page php file.

    I know I can add the slider to the main_page.tpl file in BD plugin but I want the slider to strech across the top of the page including the sidebar. this means I need to do it on the page template with a conditional.

    The code I’m using is

    if ($page_id = wpbdp_get_page_id('main')) {
    echo 'insert slide call';
    }
    else {}

    This works but it inserts the code into all the pages – the home page, categories and single pages.
    I’ve tried lots of different possibilities such as ‘home’, ‘index’, ‘front’, ‘directory’ but I can not find the page id for the main entry page to the directory.

    Could you let me know what the id is please 🙂
    thanks
    Kevin

    http://wordpress.org/plugins/business-directory-plugin/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author businessdirectoryplugin
    Participant

    @businessdirectoryplugin

    Hi Kevin,

    I will need to ask my developer this question–I don’t know the answer off hand. I’ll ask and let you know. It may be a few days, since he’s working through prior support requests right now.

    kevin heath
    Participant

    @ypraise

    Hi

    thanks for responding.

    There’s not rush on it. I’m going to try another approach later today by using the main id and then try and use some filtering to exclude archives and singles pages.

    that may work.

    kevin

    kevin heath
    Participant

    @ypraise

    Hi

    Don’t worry about it. I’ve used a php call to find the url of the main directory and then run the conditional on that :

    $bdhp = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ;
    
    if ($bdhp == 'wildlifenews.co.uk/wildlife-holiday-directory/') {
    echo 'insert slide call';
    }
    else {}

    thanks
    Kevin

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Trying to find id of main home page for directory’ is closed to new replies.