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

    I want to add a widget are for after my blog posts. Admittedly I’m I don’t totally understand Hooks and tried the below two codes with no luck

    add_action(‘ava_after_content’, ‘custom_func_1’, 10, 2);
    function custom_func_1() {
    if(is_single()){
    dynamic_sidebar( ‘after-post’ );
    }
    }

    THEN:

    add_action(‘ava_after_content’,’avia_after_content’);
    function avia_after_content(){
    dynamic_sidebar( ‘after-post’ );
    }

    #993559

    Hey Rgrant74,

    If you add those sections on your functions.php file, then you need to go to Appearance -> Widgets
    and from there use that sidebar to add anything you need.

    Best regards,
    Basilis

    #995088

    This is what I did but the sidebar was not there in widgets. so I assumed I did it incorrectly and came here

    #995355

    Hi,

    Thanks for the update. Did you enable the sidebar in the Enfold > Sidebar settings?

    Best regards,
    Ismael

    #995380

    hm isn’t the ava_after_content only for the loop – so if you have a blog style or look to a category list then the widget would be there.
    but on a single-post there is no hook ava_after_content

    Please Ismael – correct if i’m wrong

    btw. Rgrant74 – you have to create on appearance widgets the widget on Enfold Child Custom Widget Area – add widget area.
    Your code is only to define the place where it is inserted.

    Maybe you can use a different hook for that – but you have to style that of course for your needs:

    add_action( 'ava_before_footer', 'enfold_widget_before_footer_for_single_post' );
    function enfold_widget_before_footer_for_single_post() {
    	if(is_single()){
    	  dynamic_sidebar( 'after-post' );
    	}
    }

    and if you only wants it for single posts (not for portfolios):

    add_action( 'ava_before_footer', 'enfold_widget_before_footer_for_single_post' );
    function enfold_widget_before_footer_for_single_post() {
    	if(is_singular(post)){
    	  dynamic_sidebar( 'after-post' );
    	}
    }

    to have the same dimensions as your content – look to your settings and add it for that widget-area to your quick css:
    f.e.:

    .single #main .widget {
        max-width: 1310px;
        margin: 0 auto;
        padding: 0 50px;
    }
    #995506

    Hi Rgrant74,

    Have you followed Guenni007’s solution?

    Thank you for your input, Guenni007.

    Best regards,
    Victoria

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