Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16979

    I’ve created a dynamic template for my blog posts. I would like to edit the “post/page content” section of the template and add a line of code at the bottom. What is the file name for this ‘area’?

    #93766

    Hi,

    You can check includes > helper-templates.php and find this code

    function post_page($element)

    Regards,

    Ismael

    #93767

    I think I need to explain a little further. I was able to find the line of code you mentioned in the helper-templates.php file but I’m unsure as to where I add the code. I want to add the following code

    <div id=”fb-root”></div>

    <script src=”http://connect.facebook.net/en_US/all.js#xfbml=1″></script>

    <fb:comments href=”<?php the_permalink(); ?>” width=”880″></fb:comments>

    to appear just below and ‘page/post’ content.

    The reason I’m trying to hard code this instead of using the facebook plugin is that it does not render correctly or show when using dynamic templates.

    #93768

    Search for following code in includes/helper-templates.php:

    if($contact_page_id == $query_id)
    {
    ob_start();
    get_template_part( 'includes/contact-form' );
    $output .= ob_get_contents() ;
    ob_end_clean();
    }
    }

    $output .= "</div></div>";

    and replace it with:

    if($contact_page_id == $query_id)
    {
    ob_start();
    get_template_part( 'includes/contact-form' );
    $output .= ob_get_contents() ;
    ob_end_clean();
    }
    }

    $output .= '<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>';
    $output .= '<fb:comments href="'. get_the_permalink() . '" width="880"></fb:comments>';
    $output .= "</div></div>";

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

The topic ‘adding code to dynamic template’ is closed to new replies.