Introduce yourself here! In order to avoid spam, new users must first comment on the discussion in the 'Introductions' before they become 'full members'
Last Entries filtered by category
  • Hello,

    How hard would it be to modify the lastentries plugin a bit, to let posts belonging to a certain category out of the lastentries block?

    Here is why I want to do that: I'm now using the Twitter plugin, and I don't want to see Tweet IDs showing up in the last entries block on the right. I'd make it so that entries contained in the Twitter category wouldn't appear in there.

    Let me know how to modify the thing! :) Thanks.
  • open the fp-plugins/lastentries/plugin.lastentries.php and change the line

    $q = new FPDB_Query(array('fullparse'=>false,'start'=>0,'count'=>$num), null);

    to:

    $q = new FPDB_Query(array('fullparse'=>false,'start'=>0,'count'=>$num, 'not' => CATEGORY_ID), null);

    where CATEGORY_ID is the number you assigned to the twitter category
  • Hmm, I can't get it to work.

    I updated the line with the code above and my tweets still show up in the last entries list.

    I made sure I had the right ID, which is ID number 6 for my Twitter category. Am I doing something wrong?

    $q = new FPDB_Query(array('fullparse'=>false,'start'=>0,'count'=>$num, 'not'=>6), null);
  • A little bump here.

    Can anyone help me our with that code?

    Thanks. :)
  • It works! Thanks a lot Man. :)
  • That works great for me too but how would you also hide it from the blog index page - I still want it accessible via the list of entries in the admin panel but not show on the actual front page of the blog.

    In case anyone's wondering I want to post a lot of articles which will be included in a Hyperpage using my Static Entry plugin and I don't want to clog up the main page with these posts, but they still need to be accessible.

  • Actually it was much easier than I thought - I just added the following to my index.tpl and didn't assign a category to any post I want hidden from the front page of my blog.

    {entry}
    {if ($categories)}
    {include file='entry-default.tpl'}
    {/if}
    {/entry}

    An alternative way I remembered was to use the frontpage plugin (now added to the wiki):

    http://wiki.flatpress.org/res:plugins?&#front_page

    [Edit: The frontpage plugin works magnificently :)]

Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion