• Hi,

    I want to list the posts from a specific category through a a shortcode. By default the listing goes vertically.

    I want to show the posts horizontally (column vise), for that I understand I would need to create a template.

    The shortcode I am inserting is:

    [su_posts template="templates/teaser-loop.php" posts_per_page="-1" tax_term="5" tax_operator="0" order="desc" orderby="title"]

    now I want to make some changes in teaser-loop.php file to show the posts column vise (horizontally). Can you tell me, which piece of code should I add in this template to showcase the list of posts in 3 column vise.

    https://www.ads-software.com/plugins/shortcodes-ultimate/

Viewing 1 replies (of 1 total)
  • Thread Starter raizaduran

    (@raizaduran)

    this is the code of teaser-loop.php file. Please suggest what additional I have to add into this code to achieve the desired result.

    <div class="su-posts su-posts-teaser-loop">
    	<?php
    		// Posts are found
    		if ( $posts->have_posts() ) {
    			while ( $posts->have_posts() ) :
    				$posts->the_post();
    				global $post;
    				?>
    				<div id="su-post-<?php the_ID(); ?>" class="su-post">
    					<?php if ( has_post_thumbnail() ) : ?>
    						<a>"><?php the_post_thumbnail(); ?></a>
    					<?php endif; ?>
    					<h2 class="su-post-title"><a>"><?php the_title(); ?></a></h2>
    				</div>
    				<?php
    			endwhile;
    		}
    		// Posts not found
    		else {
    			echo '<h4>' . __( 'Posts not found', 'su' ) . '</h4>';
    		}
    	?>
    </div>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 1 replies (of 1 total)
  • The topic ‘creating a new template’ is closed to new replies.