Created
September 27, 2016 09:42
-
-
Save wpflippercode/6e2b43fe7b622de8d81e7199cafc237e to your computer and use it in GitHub Desktop.
Use own listing html with WP Posts Pro Plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wpp_layout_modifier', 'wpp_layout_modifier', 10, 2); | |
function wpp_layout_modifier( $layout_content,$post_id ) { | |
// Define your own html here and use placeholders e.g {title}, {date} etc. | |
$layout_content = '<div class="wpp_post" itemscope="" itemtype="http://schema.org/Article"> | |
{title} | |
<div class="wpp_meta"> | |
<span class="wpp_date">{date}</span> | |
<span class="wpp_author">{author}</span> | |
<span class="wpp_comments">{comments}</span> | |
</div> | |
<div class="wpp_image"> | |
{thumbnail} {content} | |
<div class="wpp_caption"> | |
<div class="wpp_readmore">{read_more}</div> | |
<div class="wpp_taxonomy"> | |
<div class="wpp_category">{categories}</div> | |
<div class="wpp_tags">{tags}</div> | |
</div> | |
</div> | |
</div> | |
</div>'; | |
return $layout_content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use wpp_layout_modifier hook to apply your own design in wp posts pro plugin. Below are the placeholders you can use in your html.
{title}
{post_link}
{content}
{thumbnail}
{read_more}
{date}
{author}
{comments}
{categories}
{tags}
{%custom_field_name%}
{taxonomy=taxonomy_slug_here}
{raw_title}
{raw_author}
{author_src}
{site_url}
{template_url}
{thumbnail_src}
{raw_date}
{view_count}
You need to define this hook in functions.php of your activated theme.