• Hello,

    I read about your plugin at SM. It looks really nice and I am working on trying to incorporate it into a facebook page. I was wondering if you could help me figure out how to exclude a couple of categories that I am using for non-blog purposes. Including only certain categories would be equally useful, if that is more practical. Thank you very much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wee-beastie

    (@wee-beastie)

    Okay,

    I have a solution that seems to be working. I will post it tomorrow. I am damn tired right now. I would love to get somebody’s feedback on the solution when I post it. Kind of a PHP noob and looking to improve my skills. Until tomorrow…

    Thread Starter wee-beastie

    (@wee-beastie)

    Okay, so I edited the following file: wpbook/theme/index.php

    Right after the start of the loop (line 100 I think) I placed the following code:

    <?php if (in_category('6')) { continue; }
    elseif (in_category('7')) { continue; } ?>

    This caused all posts in categories 6 and 7 to be passed up. They will not be displayed on my Facebook app. Now, to remove them from the list of recent posts, I “borrowed” some code from this thread (thanks ldexterldesign!!)

    In essence, I replaced this:

    <div class="box_head clearfix">
    <h3 class="wpbook_box_header">
    <?php _e('Recent Posts'); ?></h3>
    <ul>
    <?php wp_recent_posts(10); ?>
    </ul>
    </div>

    with this:

    <div class="box_head clearfix">
    
    <h3 class="wpbook_box_header">
    <?php _e('Recent Posts'); ?></h3>
    
    <ul>
    <?php
    $recentPosts = new WP_Query();
    $recentPosts->query('showposts=5&cat=-6,-7');
    while ($recentPosts->have_posts()) :
    $recentPosts->the_post();
    ?>
    
    <li><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
    
    <?php endwhile; ?>
    
    </ul>
    </div>

    So if anyone sees anything weird here that looks incorrect or inefficient, I would love to hear your thoughts. Also there is one more thing to be changed (a big one). All categories are still showing up in the list of recent posts in my profile box. The above code only works when visiting the app itself. If anyone has any thoughts on how to remove categories from the profil box, I would appreciate it. Thanks!

    Thread Starter wee-beastie

    (@wee-beastie)

    Hmm I can’t figure out how to do it and I can’t keep fussing with it right now. I have decided to use Facebook’s Notes app to import my blog. Also using the RSS Footer plugin for a little additional info on my feed items. Works well and gets the word out about my posts.

    WPbook is really awesome so far and the integrated comments feature is inspired—works beautifully. It isn’t quite what I need right now, though. Awesome job and I hope you guys continue to develop it. It’s almost there!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WPBook] Exclude categories’ is closed to new replies.