WordPress.org

Forums

Featured Posts and Custom Posts
Installation (10 posts)

  1. mmconsulting
    Member
    Posted 3 years ago #

    In your theme and in the template you need the featured functionality uses a custom query like this query_posts("post_type=professionals&posts_per_page=-1&meta_key=_jsFeaturedPost&meta_value=yes"); to grad all of the featured posts.

    This is a rather general description of what needs to be added to the theme and the template. Where specifically does this need to be placed or doesn't it matter?
    Thanks
    mmconsulting

    http://wordpress.org/extend/plugins/featured-posts-and-custom-posts/

  2. Jeremy Selph (Skilled WordPress Developer)
    Member
    Plugin Author

    Posted 2 years ago #

    Really all the plugin does as of now is add the control in the admin area to feature posts. But by using your own custom queries you can create you own template to show these featured posts or custom posts.

    Go here on how to make your own queries http://codex.wordpress.org/Class_Reference/WP_Query.

    Here is a quick example

    <?
    $myQueryIs = 'post_type=post&posts_per_page=-1&meta_key=_jsFeaturedPost&meta_value=yes';
    $my_query = new WP_Query($myQueryIs);
    while ($my_query->have_posts()) : $my_query->the_post(); ?>

    <? the_title(); ?>

    <? endwhile; ?>

  3. mmconsulting
    Member
    Posted 2 years ago #

    Thanks Jeremy - this is beyond my basic understanding of programming.

    I need something that is a little more plug'n'play.

    MM

  4. Jeremy Selph (Skilled WordPress Developer)
    Member
    Plugin Author

    Posted 2 years ago #

    Understood, I developed this one with developers in-mind. Myself being a developer finding plugins that are not bloated with features are sometimes hard to find. If you have suggestions for this plugin go here and maybe I can fit a new one into my schedule that includes more features. http://www.reactivedevelopment.net/specials/wordpress-plugin-ideas/

  5. Yukon Cornelius
    Member
    Posted 2 years ago #

    Hi Jeremy,

    Thanks for the awesome plugin. Everything works great, except there are two 'featured' stars showing for each post instead of one.

    Any ideas?

    Yukon

  6. Jeremy Selph (Skilled WordPress Developer)
    Member
    Plugin Author

    Posted 2 years ago #

    Yep, It is fixed in my new version. Hoping to fix it next month to upload. The fix is on my site here.

    But Change line 71 in plugins/js_featured_posts_and_custom_posts.php from
    $post_types = get_post_types( array( ‘public’ => true, ‘_builtin’ => false ), ‘names’ );
    to
    $post_types = get_post_types( array( ‘public’ => false, ‘_builtin’ => false ), ‘names’ );

    If this dose not work email me directly. jselph at reactivedevelopment.net

  7. Yukon Cornelius
    Member
    Posted 2 years ago #

    Jeremy, you da man! Works a treat. Thanks for getting back so quickly. Keep up the awesome work!

  8. hokic
    Member
    Posted 2 years ago #

    Hi - to me it works well. But just for an admin role. Other user roles cannot set the star on or off. Any idea? I'm using 3.5.

    Thanks ;)

  9. Jeremy Selph (Skilled WordPress Developer)
    Member
    Plugin Author

    Posted 2 years ago #

    I took a look at the code from my phone. So sorry I cant give you line numbers. In the plugin folder edit the plugin php file and search for the if statement with current_user_can. Change administer to whatever you want.

  10. DeeMo
    Member
    Posted 2 years ago #

    hi Jeremy, I just found out that the bug fix for the duplicated stars issue only works for the CPTs that have 'public' => true. The issue reappears on all CPTs that have
    'public' => false.
    I got more: if I revert line 71 of your code to ‘public’ => true, ‘_builtin’ => false (alas: before the fix), the issue happens the other way round: double stars on public CPTs, single star on non-public CPTs

    Any Idea?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Featured Posts and Custom Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic