WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts by Zemanta
custom post types (1 post)

  1. Vino247
    Member
    Posted 1 year ago #

    I noticed a few months ago you mentioned Related Posts by Zemanta does not support custom post types. Unfortunately this is critical to me as my site uses two post types for the bulk of our content; the standard "post" and "staffpost" (which are posts written by staff writers as opposed to a specific author - ie, they display no byline, about the author, etc).

    I have no problem getting Zemanta related articles to display on both standard posts and "staffposts" simply by changing the php file code from

    global $zem_rp_output;
    $zem_rp_output = array();
    function zem_rp_add_related_posts_hook($content) {
    	global $zem_rp_output, $post;
    	$options = zem_rp_get_options();
    
    	if ($post->post_type === 'post' && ...

    to

    global $zem_rp_output;
    $zem_rp_output = array();
    function zem_rp_add_related_posts_hook($content) {
    	global $zem_rp_output, $post;
    	$options = zem_rp_get_options();
    
    	if ($post->post_type === 'post' || 'staffpost' && ...

    What i can't figure out is how to get the "staffpost" posts to be included in the index of possible related articles (a filter perhaps?), and then matched and displayed among the related article query results on pages running the plugin. The two post types share all the same categories, so that shouldn't be an issue.

    the ability to add a custom post type would seem a valuable feature for many users besides myself, and would also seem much easier for your team to sort out and code than someone like myself (as there are quite a few references in the code to "post_type". Even if that were a more back end mod, rather than in the user admin interface. i.e. like if you help me out with comments in the code with: 'post' || 'your_custom_post_type_here' or the like as needed in the code.

    Any help on this would be most welcome. Otherwise I am afraid I will need to come up with an alternative to your plug-in, which seems to be an otherwise excellent plug-in.

    Thanks.

    -Justin

    http://wordpress.org/extend/plugins/related-posts-by-zemanta/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic