WordPress.org

Ready to get started?Download WordPress

Forums

Business Directory Plugin
[resolved] Trying to find id of main home page for directory (4 posts)

  1. kevin heath
    Member
    Posted 5 months ago #

    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/

  2. businessdirectoryplugin
    Member
    Plugin Author

    Posted 5 months ago #

    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.

  3. kevin heath
    Member
    Posted 5 months ago #

    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

  4. kevin heath
    Member
    Posted 5 months ago #

    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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.