Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #334410

    Hello, I am trying to look for a way to insert code in between the title + breadcrumbs area and the page content.

    I found a hook named: ava_after_main_container but this places the content after the header and before the title + breadcrumbs.

    How can I do this? Is there a full list of available hooks I could play with?

    Thanks!

    #334727

    Hi momon!

    Thank you for using Enfold.

    You can use 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 .= "CONTENT HERE>";
    	$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;
    }

    You can find some of the hooks and snippets on Theme Documentation.

    Regards,
    Ismael

    #335009

    Thank you, I will try that. I did a search on http://kriesi.at/documentation/enfold/ and could not find any information that would point me towards the available hooks in the theme.

    #335011

    FYI, just tested the code but it doesn’t seem to work on the homepage.

    #335425

    Hey!

    It will only work if the title and breadcrumbs are activated. Not all hooks are documented. You can find some on the Code Snippet section.

    Best regards,
    Ismael

    #335632

    Ok that makes sense and I can accept that limitation. In this case is there any hook that would allow me to do the same thing specifically on the homepage then? (or perhaps on a page that does not have the title / breadcrumbs setup?)

    Thanks.

    #335860

    Hi!

    You can use the ava_after_main_container hook coupled with is_home or is_frontpage conditional. :)

    Regards,
    Ismael

    #335885

    Humm, would you mind giving me the code? I am not entirely sure how to code that as suggested.

    Thanks.

    #338922

    Hi!

    Something like this:

    add_filter('ava_after_main_container', 'ava_after_main_container_append', 1);
    
    function ava_after_main_container_append() {
    	if(is_home()) {
            //SOME CODES HERE
           }
    }

    Regards,
    Ismael

    #339067

    I tried this:

    add_filter('ava_after_main_container', 'ava_after_main_container_append', 1);
    
    function ava_after_main_container_append() {
    	if(is_home()) {
    		echo 'some sample content';
        }
    }

    It did not work. There was no output on the homepage.

    #342163

    Hey!

    Replace the code with this:

    add_filter('ava_after_main_container', 'ava_after_main_container_append', 1);
    
    function ava_after_main_container_append() {
    	if(is_front_page()) {
    		echo 'some sample content';
        }
    }
    

    Cheers!
    Ismael

    #342348

    Thank you, that does work.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Adding content after title + breadcrumbs but before page content’ is closed to new replies.