Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use own listing html with WP Posts Pro Plugin
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;
}
@wpflippercode

This comment has been minimized.

Copy link
Owner Author

wpflippercode commented Sep 27, 2016

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.

  • Post Title :{title}
  • Post Links :{post_link}
  • Post Content :{content}
  • Featured Image :{thumbnail}
  • Read More Link :{read_more}
  • Post Date :{date}
  • Author Name :{author}
  • Post Comments :{comments}
  • Post Categories :{categories}
  • Post Tags :{tags}
  • Custom Fields :{%custom_field_name%}
  • Taxonomy :{taxonomy=taxonomy_slug_here}
  • Title without link :{raw_title}
  • Author without link :{raw_author}
  • Author Url :{author_src}
  • Site Url :{site_url}
  • Template Path :{template_url}
  • Featured Image Url :{thumbnail_src}
  • Post Date Without Formatting :{raw_date}
  • Total Views :{view_count}

You need to define this hook in functions.php of your activated theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.