WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Featured Posts and Custom Posts] Installation

[Plugin: Featured Posts and Custom Posts] Installation

  • 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/

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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; ?>

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

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

    MM

    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/

    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

    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

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

    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 😉

    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.

    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?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Featured Posts and Custom Posts] Installation’ is closed to new replies.