• Resolved langers1970

    (@langers1970)


    Hi there. Great plugin. Is there a simple way of amending the templates file so that recommended posts appear as a bulleted list? Many thanks, Paul

Viewing 1 replies (of 1 total)
  • Anonymous User 9866578

    (@anonymized-9866578)

    Hi Paul,

    Thank you for trying the plugin and the question. Below is one way that you could update the theme/custom-templates.php file to create a bulleted list of recommended posts.

    Basically you surround the stuff denoted by {kp_*} with the HTML you want to use. You can also remove any of those tags {kp_*} that you don’t want to use.

    If you want to use the original template, as it appears in theme/templates.php, you leave the value blank such as in the case of $kp_templates["kp_widget"].

    Thanks again for trying the plugin!
    Adam

    ==== In theme/custom-templates.php ====

    <?php
    /**
     * This file will allow you to overwrite theme and widget elements
     * 		To see an example, please refer to templates.php
     **/
    
     // This controls how the Kindred Posts widget will be displayed within your theme.
    $kp_templates["kp_widget"] = '';
    
    // This controls how {kp_recommender} will be displayed if it exists in $kp_templates["kp_widget"]
    $kp_templates["kp_recommender"] = '
    		<div class="kindredposts">
    			<ul>
    				{kp_recommendedPosts}
    			</ul>
    		</div>';
    
    // This controls how {kp_recommendedPosts} will be displayed if it exists in $kp_templates["kp_recommender"]
    $kp_templates["kp_recommendedPost"] = '
    	{if has_content}
    
    	<li class="kp_post">
    		{if show_post_thumbnail}
    			<span style="{kp_widget:postimage_style}"><a onclick="{kp:trackingcode}" href="{post_url}">{post_thumbnail}</a></span><br />
    		{/if show_post_thumbnail}
    
    		<div>
    		{if show_post_title}
    			<span style="{kp_widget:posttitle_style}"><a onclick="{kp:trackingcode}" href="{post_url}">{post_title}</a></span><br />
    		{/if show_post_title}
    
    		{if show_post_author}
    			<span style="{kp_widget:postauthor_style}">{kp:By}
    				<span>
    					<span class="author vcard">
    						<a class="url fn n" onclick="{kp:trackingcode}" href="{author_user_url}" rel="author">{author_user_nicename}</a>
    					</span>
    				</span>
    
    				{if show_post_date}
    					<span style="{kp_widget:postdate_style}"> {kp:on}
    						<span class="entry-date">
    							<time class="entry-date" datetime="{post_date}">{post_date_nice}</time>
    						</span>
    					</span>
    				{/if show_post_date}
    			</span><br />
    		{else show_post_author}
    			{if show_post_date}
    				<span style="{kp_widget:postdate_style}"> {kp:On}
    					<span class="entry-date">
    						<time class="entry-date" datetime="{post_date}">{post_date_nice}</time>
    					</span>
    				</span><br />
    			{/if show_post_date}
    		{/if show_post_author}
    
    		{if show_post_teaser}
    			<span style="{kp_widget:postteaser_style}">{post_excerpt}</span><br />
    		{/if show_post_teaser}
    		</div>
    	</li>
    
    	{/if has_content}';
Viewing 1 replies (of 1 total)
  • The topic ‘Bulleted lists’ is closed to new replies.