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

    Hi there,
    I’d like to remove the title and breadcrumbs from the widget area, and instead add a custom widget area.

    I’ve already created the widget area, and just need to know where to include the php:
    echo do_shortcode(“[av_sidebar widget_area='FeatureBox']“);

    If there is a better way to go about this, I’m open to suggestions.

    Thank you kindly for your time.

    #524264

    Hi LeJager!

    Not really sure I understand. Are you trying to remove the title of a widget? If so then you would just need to leave the title setting blank.

    If your talking about the title container where the title and breadcrumbs display then that is not a widget area. Can you send us a link to your page so we can take a look? You can set your reply as private if you wish.

    Best regards,
    Elliott

    #524282

    Hi Elliot,
    Haha sorry, I can see how my question was confusing.

    I did mean the title container. I’d like to remove the title and breadcrumbs from the title container and instead display a custom widget area inside the title container. I’m pretty sure I can do this by adding the following php code:

    <?php echo do_shortcode(“[av_sidebar widget_area='FeatureBox']“); ?>

    I’d just like to know the best place to insert the code, and what I need to take out in order to remove the title and breadcrumbs.
    I could insert the code in the single.php and page.php template files, but I’d prefer that the widget displays within the title box so that I can use the admin interface to hide the title container on a per page basis.

    Thank you for your kind assistance.

    #525713

    Hey!

    You can find that on line 330 in the /enfold/functions-enfold.php file.

    'html'			=> "<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}>{additions}</div></div>",
    

    You can either change it there or use the avf_title_args filter. Ismael posted a nice snippet here, https://kriesi.at/support/topic/adding-content-after-title-breadcrumbs-but-before-page-content/#post-334727.

    Regards,
    Elliott

    #531300

    Hi Elliot,
    I’ve tried the suggestions and while I’m able to add content to the title bar, it ends up breaking the page layout, specifically the right hand sidebar.

    For example:
    http://dev-12mk.pantheon.io/vegan-birthday-cake-recipe/

    See below the code I’ve added to the enfold-child functions.php

    Thank you,
    Matt

    add_filter('avf_title_args', 'avf_title_args_append', 1);
    
    function avf_title_args_append($args) {
    	$appendcontent  = "<div class='container_wrap append-content'>";
    	$appendcontent  = "<div class='container'>";
    	$appendcontent .= do_shortcode("[av_sidebar widget_area='FeatureBox']");
    	$appendcontent .= "</div>";
    	$appendcontent .= "</div>";
    	$args['html'] = "<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}>{additions}</div></div>{$appendcontent}";
    	return $args;
    }
    #531611

    Hey!

    Try switching this line.

    $args['html'] = "<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}>{additions}</div></div>{$appendcontent}";
    

    To this.

    $args['html'] = "<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}>{additions}{$appendcontent}</div></div>";
    

    Cheers!
    Elliott

    #531649

    Hi Elliot,
    Thanks for the suggestion. It still breaks the page unfortunately. Please advise.

    #531980

    Hey!

    My bad. There’s a missing dot in the $appendcontent variable. Please replace the code with this:

    add_filter('avf_title_args', 'avf_title_args_append', 1);
    
    function avf_title_args_append($args) {
    	$appendcontent  = "<div class='container_wrap append-content'>";
    	$appendcontent  .= "<div class='container'>";
    	$appendcontent .= do_shortcode("[av_sidebar widget_area='FeatureBox']");
    	$appendcontent .= "</div>";
    	$appendcontent .= "</div>";
    	$args['html'] = "<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}>{additions}</div></div>{$appendcontent}";
    	return $args;
    }

    Cheers!
    Ismael

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