Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1465251

    Hi guys,

    in the latest enfold version 6.03

    The following is supposed to add a widget to just the blog pages. This is no longer the case – The widget area is applying to all pages.
    Please can you let me know how we resolve this?
    // Add Widget above news pages
    add_action( ‘ava_after_main_title’, ‘enfold_customization_blog_widget_area’, 50 );
    function enfold_customization_blog_widget_area() {
    dynamic_sidebar( ‘blogheaderwidget’ );
    }

    #1465254

    Sorry the issue here is the hook above never used to load on shop pages. It now loads on all pages which is causing the button I would normally load on the shop to not work because both filter news and filter products buttons are visible.

    Can we get a new hook that only adds a widget area to the Blog in the same way that the before shop look adds a widget area before the products in the shop?

    This is quite urgent see this post for context: https://kriesi.at/support/topic/hook-to-add-widget-area-above-blog-loop/

    #1465255

    See test area showing issue where my two widget areas are both showing on the shop when it only used to show one in the previous enfold version.

    #1465306

    Hi,
    You could add a check for the page that you want you show it on, for example if the page ID is “1028” use this:

    add_action( 'ava_after_main_title', 'enfold_customization_blog_widget_area', 50 );
    function enfold_customization_blog_widget_area() {
        if ( is_page(1028) ) { 
            dynamic_sidebar( 'blogheaderwidget' );
        }
    }

    or you can use the page slug like this:

    add_action( 'ava_after_main_title', 'enfold_customization_blog_widget_area', 50 );
    function enfold_customization_blog_widget_area() {
        if ( is_page('your-page-slug') ) { 
            dynamic_sidebar( 'blogheaderwidget' );
        }
    }

    The WordPress Conditional Tags documentation state:

    There is no conditional tag for the blog page. You have to use both is_home() and is_front_page() to detect this page, but those functions can be misused.

    They offer a different solution, try reading it, but I think the two solutions above will work fine.

    Best regards,
    Mike

    #1465410

    Hi Mike,

    Unfortunately what you have suggested doesnt work. BUT IT SHOULD!!!

    Using the documentation guide – This works:

    add_action( 'ava_after_main_title', 'enfold_customization_blog_widget_area', 50 );
    function enfold_customization_blog_widget_area() {
    	$check_tjnewswidget = true;
    	
    	if ( is_home() ) { 
        $check_tjnewswidget = false;
        }
    	
    	if( !$check_tjnewswidget ) {
            dynamic_sidebar( 'blogheaderwidget' );
        }
    }

    Not quite as per documentation but I like using the true and false method of determining if something is a particular thing.

    #1465423

    Hi,
    Glad to hear that you have this sorted out, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Bug:Blog Header hooks no longer working properly’ is closed to new replies.