Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #163779

    Hello, when i use the blog section in the template builder, it always adds the blog widgets on top of the normal page widgets. Is there any way to stop this effect?

    #163976

    Hey jwt2030!

    Try following – open up sidebar.php and replace

    
    		// general blog sidebars
    		if ($avia_config['currently_viewing'] == 'blog' && dynamic_sidebar('Sidebar Blog') ) : $default_sidebar = false; endif;
    

    with

    
    		// general blog sidebars
    		$avia_active_template = ('active' == get_post_meta($post_id, '_aviaLayoutBuilder_active', true) ? true : false;
    		if ($avia_config['currently_viewing'] == 'blog' && dynamic_sidebar('Sidebar Blog') && !$avia_active_template) : $default_sidebar = false; endif;
    

    Best regards,
    Peter

    #164543

    Hello, thank you greatly for your update. But when i tried with the above code none of my sidebars would show.
    Also i get a syntax error on this line below
    $avia_active_template = (‘active’ == get_post_meta($post_id, ‘_aviaLayoutBuilder_active’, true) ? true : false;

    #165466

    Hello!

    It’s a quote issue, replace the quotes by simple or double quotes.

    $avia_active_template = ("active" == get_post_meta($post_id, "_aviaLayoutBuilder_active", true) ? true : false;

    Best regards,
    Josue

    #165486

    Hello, i replaced the code and i am still getting an error in dreamweaver and the sidebar will not show up.
    I have uploaded a file so you can inspect.

    portalcybermall.com/sidebar.txt

    #165491

    Hi!

    I see the error, it was a parenthesis, use this:

    $avia_active_template = "active" == get_post_meta($post_id, "_aviaLayoutBuilder_active", true) ? true : false;

    Cheers!
    Josue

    #165496

    Hello, the sidebars are showing up now, but the pages are still showing the widgets from the blog sidebar.
    I tried to refresh the cache

    Does any of this code need to be changed

    if ($avia_config[‘currently_viewing’] == ‘blog’ && dynamic_sidebar(‘Sidebar Blog’) && !$avia_active_template) : $default_sidebar = false; endif;

    #165941

    Hi!

    WordPress sidebars stack. So if you have widgets in display everywhere, they display ever. If you have them in Blog but you also have the blog on a page then both will show (because a blog element is on a page).

    You can use this plugin to keep specific widgets off of pages with WordPress conditional code: http://wordpress.org/extend/plugins/widget-logic/

    Regards,
    Devin

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

The topic ‘Template Builder – Blog’ is closed to new replies.