• Hello!

    Apologies if this topic has been tackled.

    I’m using (child) tracks.

    Is it possible to add text in between the posts on the homepage and possibly a call to action?

Viewing 1 replies (of 1 total)
  • Theme Author Ben Sibley

    (@bensibley)

    This is possible, it will just require working with some PHP.

    You’ll want to copy the index.php file into your child theme. Then you can edit “the loop” on lines 6-13 like this:

    <?php
    	if ( have_posts() ) :
                    $count = 1;
    		while ( have_posts() ) :
    			the_post();
    			ct_tracks_get_content_template();
                            if ( is_archive() && $count == 3 ) {
                             echo '<div class="between-posts">';
                               echo '<p>Text here</p>';
                             echo '</div>';
                            }
    		endwhile;
    	endif;
    ?>

    This adds a count variable starting at 1, and then if you’re on an archive page (blog, category, tag) and just output the third post, it will output some HTML and text.

    You can use this as an outline, and modify it to include text before/after any number of posts on the blog/homepage.

Viewing 1 replies (of 1 total)

The topic ‘Adding Text between Posts’ is closed to new replies.