jeanpatrick
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Can't read the plugin and hack forumsCan you explain which plugin had a bug? I’m seeing YellowFish.php errors every where as well
Forum: Plugins
In reply to: [Plugin: Invite Friends] Fatal error when I activate1) Go to your plugin folder
2) Open ‘/invitefriends-plug-in/’
3) Open ‘/bp-invitefriends.php’
4) On line 49 change ‘bp_core_add_subnav_item’ to ‘bp_core_new_subnav_item’Works so far for me
Forum: Plugins
In reply to: Edit get_calendar() function to allow show posts from specific categoryThings to take into account:
If a month has 10 blog posts and 10 posts not in the ‘blog’ category, some posts won’t show.
This is because the default amount of posts to be shown per page is 10.
I’m still trying to figure out a workaround for this.
Most likely, if you want to maximize the archive page you’re going to have to build a custom query that selects posts by month refined by category.
After I figure that one out I’ll post my code here.
Forum: Plugins
In reply to: Edit get_calendar() function to allow show posts from specific categoryYes you should add it to your theme’s functions.php file, and you should see a new widget in the widgets menu that you can add to a sidebar.
You should see ‘Customized Calendar’ in the list of available widgets.
Do you have anything else in your themes functions.php file?
Forum: Plugins
In reply to: Edit get_calendar() function to allow show posts from specific categoryHi I had the same situation on my blog.
I modified code from a pastie on one of the posts regarding category calendar posts, made it work, and combined it with an archive template to achieve the desired effects.
First, add this code to your functions.php file:
http://pastie.org/491698Then, create or edit your date/archive.php file to exclude posts not within your category. For me, the category name is ‘blog’, which has the ID 7 (you can see me use ID 7 above when I call the custom calendar function).
<? if (have_posts()) { while (have_posts()) { the_post(); if (in_category('blog')) { $link = get_permalink(); $title = the_title(NULL,NULL,FALSE); $content = get_the_excerpt(); $post_id = $post->ID; $results[] = Array('id' => $post_id, 'title' => $title, 'link' => $link, 'content' => $content); } } } if ($results) { foreach ( $results as $result ) { ?> <div class="feature"> <h2><a href="<?=$result['link'];?>" title="<?=$result['title'];?>"><?=$result['title'];?></a></h2> <?=$result['content'];?> <div class="clear"></div> </div> <!-- div#.feature --> <? } } else { ?> <p>Sorry, no posts found</p> <? } ?>You can see a working example here:
http://biggreencouch.com/demo_site/2009/03/The top carousel items are pulled from blog posts in the ‘frontpage carousel’ category, however the archive pages and the calendar only show posts from the ‘blog’ category.
Example, include multiple categories:
Let’s say you’re blog section has more than one category (6=blog featured, 7=blog normal). Gather your category IDs and category slugs.
In functions.php:
echo get_calendar_custom('6,7');This tells the calendar to draw from category IDs 6, and 7.
*** Make sure you pass a string of comma seperated values ***
YES: get_calendar_custom(‘1,5,12,16’);
NO: get_calendar_custom(7,9,12);Next, edit your archive.php or date.php loop at the part where you say if in_category, add all the category slugs (you can also pass the category IDs or the proper name, I personally like slugs because I can see the name):
if (in_category('blog,blog-featured')) {Let me know if this helps, it works for me I’m using WP 2.7.1
Forum: Plugins
In reply to: calendar by categoryGo to http://wordpress.org/support/topic/266627
I’ve combined a few things from posts and come to a solution