This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Hooking to the featured area

  • Creator
    Topic
  • #6569
    srumery
    Participant

    I need to add a custom search bar below the menu and above the rest of the page content. It has a few drop down fields and a general search box to help filter results. It’s more of an advanced search for a specific custom post type. I am thinking of adding it to the header file but I don’t want it on the homepage and I might leave it off a few more. Would it be best to use the featured area (themeblvd_featured) to display my search bar? Would hooking into themeblvd_main_top be a better solution?

    When I referenced the support documentation, I found this page and it got me thinking of using the featured area.
    http://dev.themeblvd.com/tutorial/hooking-to-the-featured-area/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #6578
    Jason Bobich
    Keymaster

    I would say the featured area would be the most complicated action to hook to, which is why I wrote the article. But specifically where you want to hook your content is all up to you and depends on your design. Just experiment a little and see where you want to place it.

    Within any content you hook, you can use conditionals to determine on what page of your website it shows:

    http://codex.wordpress.org/Conditional_Tags

    #6632
    Martin
    Participant

    Hi Jason,
    I see that http://dev.themeblvd.com/tutorial/hooking-to-the-featured-area/ is still under construction.

    I wonder, if there is any way to “activate” featured area for any page using some code in functions.php, i.e. without using Builder?

    Example: I want to use Featured area on every single page for different slogans. Official way should be to create different layouts in Builder for each individual page and then assign each page to corresponding custom layout. Easier way (which I use now) is to create only one “dummy” Layout in Builder, add Columns Element to Featured Above and Content to Primary Area. Then I set Columns to 1 Column / 100% and enable Raw Content in Columnt #1 and leave text area empty. This is the way, how I “activate” Featured area in this custom layout. Then I assign all pages to this layout and can hook different content for different pages, like this:

    function slogan_for_contact_page() {
    	if ( is_page( 'contact' ) ) {
    		echo 'My slogan for contact page';
    	}
    }
    add_action( 'themeblvd_featured', 'slogan_for_contact_page' );

    Could you please explain, if there is any smarter way, how to “activate” Featured area only with php function without touching the Builder?

    Thanks a lot!
    Martin

    #6639
    Jason Bobich
    Keymaster

    I’ll finish the article today.

    #6670
    Jason Bobich
    Keymaster
    #6687
    Martin
    Participant

    Thank you Jason,

    great article, everything is now clear !

    Martin

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.