Exclude Categories from Feed, Archives, Search, and Home page in WordPress

January 14, 2010 – 8:10 am | by Rebecca Markowitz

We often find ourselves looking for the best and easiest way to exclude categories or pages from the navigation menu, the WordPress loop, the category list, the feed, the search, and/or the archive. It’s so easy to forget one of these elements and accidentally let that category slip into the blogstream. We actually wrote about a few WordPress plugins that exclude categories two years ago, but it’s definitely time to revisit this issue.

Recently, Miriam found an AMAZING plugin, Simply Exclude by Paul Menard, which is basically excluding heaven… if there is such a thing.

Exclude categories WordPress

Advanced Category Excluder vs. Simply Exclude

You may have come across the Advanced Category Excluder plugin, and wonder why we didn’t use that one. Here’s why:

Advanced Category Excluder (ACE) vs.  Simply Exclude:

  • Advanced Category Excluder conflicts with the Exclude Pages plugin (described below) which excludes pages  from the nav bar. Simple Exclude does not. When I activated it ACE all the pages that had been excluded with the Exclude Pages plugin appeared on the nav bar.
  • ACE also offers you to exclude Pages, which is so annoying since you have to go through a long list of all the pages on your site to see which you want to exclude, and they appear in long lists without any indication of parent pages and sub-pages. Also, there’s no easy way to exclude pages when you are adding or editing a page.
  • With ACE you have to first publish a post in a category, and only then will that category appear in the list of categories for exclusion. This means that if you want a category to not appear in the RSS feed etc., your first post in that category has to.

How to manually exclude categories in the theme files

And here are a few tips on how to exclude categories manually from the feed and the loop if you still prefer some good ol’ fashioned manual labor.

How to Manually Exclude a Category from a RSS feed

Place the following code in your functions.php file replacing 12 with your category and commas for additional categories. Tip from Web Kreation.

function myFeedExcluder($query) {

if ($query->is_feed) {

$query->set(‘cat’,'-12′);

}

return $query;

}

add_filter(‘pre_get_posts’,'myFeedExcluder’);

How to Manually Exclude a Category in Feedburner

Under Edit Feed Details add a ?cat=-93 or whatever the category ID number is so it comes out like:  http://domain.com/feed?cat=-93

How to Manually Exclude a Category from the Loop

Add this code BEFORE the loop and change 52 to whatever category you want to exclude

<?php query_posts(’showposts=2&cat=-52′); ?>

Bonus: Easily Exclude Pages

Since we’re discussing excluding stuff from your WordPress blog, here’s a related plugin that we love called Exclude Pages by Simon Wheatley. It’s easy to use and great to give clients for excluding pages from their navigation menu. Exclude Pages adds a checkbox on the edit Page page that users can click to select to exclude the Page they are working on from any place that lists all Pages, like the navigation bar.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Display sticky post and exclude it from recent posts list in WordPress

January 11, 2010 – 3:30 pm | by Rebecca Markowitz

We were working on a WordPress site that needed to display a sticky post at the top of the blog page with one style, and then below it a list of the most recent posts with a completely different style.

I realize that you can just style the sticky post using the sticky-related classes provided by WordPress:

<div <?php post_class(); ?>> and .sticky class

but I needed to have design elements appear in between the sticky post and the rest of the recent posts, and the recent posts needed to have a completely different design than the sticky. Therefore I decided to go with a 2 loop solution. Once we were using two loops, we had to also make sure that sticky post did not repeat itself and appear in the list of recent posts following it.

Nathan Rice provides a lot of useful information about sticky posts but I couldn’t get the code he posted to work properly. So I went on a hunt to figure it out.

How to display a sticky post

The best solution I found for how to display a WordPress sticky post was a comment by Eduardo on Justin Tadlock’s post Get the Latest Sticky Post. He gave the following code:

<?php
$sticky = get_option( ’sticky_posts’ );
query_posts( array( ‘post__in’ => $sticky, ‘caller_get_posts’ => 1, ‘orderby’ => ID, ’showposts’ => 2 ) );
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href=”<?php the_permalink(); ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”>
<?php endwhile;?>

<?php endif; ?>

It worked very nicely.

How to exclude sticky posts from a list of recent posts

I then wanted to show a list of 3 recent posts that excluded the post that had been defined as sticky. After many trials and errors with different solutions posted around the web, I finally found one that worked on the WordPress Support Forum.

<?php $sticky = get_option(’sticky_posts’) ;

$post_to_exclude[] = $sticky[0];

$args=array(
‘caller_get_posts’=>1,
’showposts’=>2,
‘post__not_in’=> $post_to_exclude,
);

query_posts($args); ?>

<h2><a href=”<?php the_permalink() ?>”><?php the_title(); ?></a> </h2>

<?php while (have_posts()) : the_post();  ?>

<?php endwhile;?>

So there you have it: a workable way to have a WordPress sticky post with one style, and a list of recent posts excluding the sticky post with a completely different style below the sticky post.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

My 2010 New Year resolution: to say thank you to WordPress

January 4, 2010 – 11:34 am | by Miriam Schwab

Generally, the only thing a new Gregorian year (there are other calendars out there too, you know) means to me is that I must remember to write 2010 on checks. But since I’ve been reading so many New Year’s posts on other blogs, it got me thinking about what I have to say as we welcome writing 2010 on checks. And here it is:

Thank you Automattic and the WordPress community.

While eating breakfast this morning, I started thinking about how much of our business’ activities revolve around WordPress – developing sites and blogs on WordPress, hosting WordPress sites, providing WordPress support and consultation, and more. And then I started thinking about how many people there are out there who also make a living from WordPress services. There must be thousands, if not hundreds of thousands of WordPress service providers around the world.

In addition, there are thousands of others who, thanks to the relative simplicity of WordPress and the freemium hosted service at WordPress.com, have managed to set up their own dynamic web presence to help them grow their businesses or organizations.

In Judaism, our tradition teaches us that the most ideal way of giving charity is to give someone else the ability to generate their own income (similar to the saying about teaching a man to fish rather than giving him fish). Automattic has not only created their own business, but has helped others create their own streams of income. I think this is particularly significant for those in the developing world: with WordPress they can provide their services to clients all over the world, without the need for expensive software and supplies, thus increasing their ability to generate income for themselves and their families.

Automattic obviously plays a big role in the success of WordPress, but without the community I don’t think WordPress would be where it is today. Automattic’s approach to the community is of course what made it so robust, thanks to the fact that the software is Open Source, and thanks to the implementation of an API system that allows others to add on features through the development of plugins. It’s also due to the environment that Automattic created, whereby the community is encouraged to support and be active in the development of WordPress.

The WordPress community certainly took up the torch, and has helped WordPress spread like wildfire. Three years ago, when I was researching the available Open Source platforms for creating dynamic websites, one of the reasons I settled on WP was because of the amazingly useful community generated information I found. And that’s why I started this very blog: to give back to the community in my own small way.

So thank you WordPress community.

Thank you Automattic.

Thank you for WordPress.com, Akismet, Gravatar, WordCamp, the Codex, and BuddyPress.

Thank you for creating such an awesome piece of software, and for continuing to innovate and listen to the community.

Happy New Year!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

WordPressGarage.com now on WPGarage.com, and how to move a domain with a 301 redirect on WordPress

December 31, 2009 – 2:30 pm | by Rebecca Markowitz

About a year ago, a discussion arose in the WordPress community about third-party sites that use the word “WordPress” in their domain name. We posted our opinion on this issue since WP Garage has been running (until yesterday) on a domain with the word WordPress in it. We put WordPress in our domain to show our ever-growing love for WordPress,  but realized how important it is to the founders of WordPress that we take out their brand name, so yesterday we finally moved this blog to WPGarage.com instead. Come on over and take a look.

During the process, we had to do a 301 redirect from WordPressGarage.com to WPGarage.com in order to retain traffic from inbound links and search engines. It’s important in this type of situation to do a 301 permanent redirect so that all of the new pages on the new site are seen by the search engines as equivalent in terms of value and ranking as the old site.

We followed Yoast’s guide for how to Move your WordPress blog to a new domain in 10 steps! which was very helpful. However, along the way, we realized that there are a few things in his directions that might not be clear to readers (they weren’t so clear to us at times), so here are some things to pay attention to when doing a 301 redirect for a WordPress blog:

  1. Put the robots.txt on the new domain.
  2. Copy the database and files to the new domain.
  3. Edit wp-config.php on the new domain to have the right database settings as described by Yoast.
  4. Now set up your new blog install, with the same settings as on the old domain. If you import the database it will retain pretty much all of your settings from the old site.
  5. The Search and Replace plugin for replacing instances of your old URL with the new one across your database works great.
  6. This step is fine.
  7. Yoast says to remove the robots.txt file. We left it but removed the slash after the word Disallow.
  8. The code Joost gives to put in your .htaccess file refers to a site moving from a sub-directory on one domain to a the root directory on another domain. It might not be clear what you need to use if you’re moving from the root directory of one domain to the root directory of another. So, on your old blog, add one of the the following lines to your apache .htaccess or vhost-config:
    Redirect 301 /blog/ http://www.newdomain.com/
    This is if you're moving from domain.com/blog to domain.com
    OR
    Redirect 301 / http://www.newdomain.com/
    This is if you're moving from olddomain.com to newdomain.com
  9. IMPORTANT NOTE: Don’t underestimate the importance of the slash and spacing. In Yoast’s example, we took out the entire /blog/ part of the line and the old site would only forward to the homepage of the new site. Luckily, we found this article which showed the importance of the slash placement.

    WordPressGarage htaccess code

  10. Joost says to remove the old blog and database. I’m not sure if I would do that so quickly.
  11. Change your FeedBurner account, if you have one, to pick up the correct feed and continue delivering it to subscribers..
    Note: You can only change the Feed Title and Original Feed. You can’t change or “redirect” the Feed Address itself.Feedburner for WPGarage

Test it out and hope Google figures things out and displays your new site in the serps.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

The importance of the wp_footer(); plugin API hook

November 12, 2009 – 2:03 pm | by Miriam Schwab

About a week ago I wrote a post about a new WordPress plugin released by Semantinet called Headup. When Semantinet first asked me to install the plugin, it actually didn’t work. They looked into it and realized that the reason for this is that WordPress Garage doesn’t have the wp_footer hook in the footer. I didn’t get too excited about that, and told them there are probably a lot of blogs out there that don’t have this hook, and that they should make sure their plugin is compatible with blogs that don’t have the hook so that it will work in most cases.

They took my advice and modified the plugin, and it worked.

Today, one of our clients contacted us saying that they are trying to install a certain  WordPress analytics plugin, and the code that the plugin produces appears in the footer when they switch to the default theme, but it doesn’t work with the theme we created for them.

I realized that it must be the same missing hook problem, and we looked into it and identified the following hook which indeed was missing from their theme:

<?php wp_footer(); ?>

We added it to their footer.php file, and the plugin started to work!

So take note theme developers for the WordPress community and for private clients (I am including myself in this): it is important to run through a checklist of code snippets that your WordPress themes should contain so that users and clients can enjoy smooth running WordPress sites.

<?php wp_footer(); ?> is just one of them. The WordPress Codex has a very handy page called Theme Development that goes through functionality and code that WordPress themes should have. Here are some important sections:

Theme Template Files List – list of all the possible theme template files.

Plugin API Hooks – list of all the pieces of code needed for plugins that use those hooks to work. Weblog Tools Collection reported that another API hook that’s regularly forgotten in themes is wp_head();.

The best place for wp_footer();

WP Designer (when he was still writing his amazing blog) wrote about this hook and discusses the ideal placement for it within your theme files. He says that often plugins will break your theme if they use this hook, so it’s best to put it in a style-less div container “that your layout doesn’t depend on. Otherwise, you might end up with an incomplete layout while waiting for a slow loading plugin.”

I’m a bit embarrassed that I wasn’t aware of this apparently basic yet important WordPress theme issue. But I hope that by admitting my lack of knowledge I can help some of you solve plugin problems or theme problems.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Headup Semantic WordPress plugin automatically adds rich content to your blog

October 26, 2009 – 9:12 am | by Miriam Schwab

A new WordPress plugin called Headup was released about a week ago by SemantiNet, a startup dedicated to developing Semantic Web technologies and platforms. The plugin works on top of the company’s existing technology, and automatically adds rich content to terms that appear in your blog posts.

I installed it here on WordPress Garage so you can see it in action, but basically the way it works is key terms get a dotted orange underline (which helps differentiate them from your regular links), and when you mouse-over those terms a pop-up window appears with information tabs. These tabs display the following content:

  1. A short summary about the key-term (Wikipedia style information)
  2. Related News, Articles & Posts
  3. Related images from Flickr, Panoramio, Picasa, etc.
  4. Related Tweets
  5. Related Videos from Youtube
  6. Related Products from Amazon
  7. How your readers Facebook friends relate to the key term (requires readers to approve Facebook connection)

For geographic locations the pop-up will display a Map tab, and for films a Trailer tab will be displayed.

The field of semantic technologies is so new that Headup is only one of 9 WordPress plugins that have “semantic web” as a tag in the plugin directory.

How to install the Headup plugin

  1. Go to “Add New” in the WordPress plugin menu.
  2. Enter “headup” as the search term to find the plugin in the directory. There will only be one result for this term.
  3. Click the “Install” button on the far right, and then activate the plugin.
  4. You can configure some settings for the plugin under Settings > Headup for WordPress. There you can choose a maximum number of annotations to display on a page, how many times the same term should be annotated, and whether hyperlinks should be annotated as well.

It will take about an hour before the key terms on your site start displaying the dotted orange highlights. Here’s a short video explaining how to install the plugin:

[youtube]http://www.youtube.com/watch?v=3G20whW3yOs[/youtube]

Here’s another video overview of the Headup Blog Widget and WordPress plugin.

Why would you use this plugin?

The creators of the plugin say that by offering this type of content, you can “reduce bounce rates and increase your readers’ engagement.” Since I tend to judge the world by my own preferences, I was a bit skeptical as to whether such a feature could really achieve those goals since I prefer to find my own info rather than have it dictated to me. Luckily, my pal Mike works at SemantiNet so I decided to ask him a few questions about this plugin, their technology, the semantic web in general, and whether he agrees that Cookies and Cream is Ben & Jerry’s best ice cream flavor.

WPG: Mike, tell me a bit about SemantiNet and what you do there.

Mike: Whereas much of the activity related to semantic web is still very much academic and theoretical, SemantiNet’s products are among the few examples of practical applications of next generation web technology anyone can enjoy today.

What our technology does is identify key-terms in publications & blogs and then provide relevant and personalized related content in real-time. For example, say you’ve written a post about Barack Obama recently being elected in Oslo to be honored with the Nobel Peace Prize. What we’ll do is automatically identify the term “Barack Obama” as being president of the US, and suggest content related to him, and identify the term “Oslo” as being a city, and suggest content related to it too.

The big deal here is that the technology realizes that Oslo, the city, has different attributes from Obama, the person, so it will offer different types of information for each. For example, Oslo’s Headup results would include a city map, while Obama’s would not.

As for me, I’m a Project Manager in the company and am responsible for managing the company’s site and blog widget.

WPG: Call me an ignoramus Mike (don’t look so happy about the opportunity), but I still don’t quite get what the semantic web is about. Please explain and make me feel more intelligent.

Mike: What makes companies like SemantiNet exciting is that their understanding of online content goes beyond the basic key-word matching we’re familiar with from current search technologies, and enters the realm of true object identification. This is a fancy way of saying that whereas today, if you search for “Apple” you’ll get results related to the company and the fruit indiscriminately, the vision for Semantic Web is that the same search will deliver results that relate not only to “Apple” but also to “Steve Jobs,” “iPhones,” ”iPods,” etc. even if the word “Apple” isn’t explicitly mentioned in the text results.

For more information about the Semantic Web I recommend seeing Sir Tim Berners Lee’s excellent TED talk on the subject.

WPG: How can bloggers and publishers offer this type of rich information on their own sites?

Mike: To date we have three products people can use to get a better feeling for what this does: the Headup Firefox addon, the Headup publisher and blogger widget, and most recently, the Headup WordPress plugin.

WPG: Why should bloggers install the Headup plugin?

Mike: Bloggers who install our widget will gain longer engagement times and reduced bounce rates. Besides these advantages the widget has the ability, via the “Friends” tab, to enable readers to personalize their reading experience and see how the key terms you blogged about relate to their circle of friends. To the best of my knowledge no other widget out there has this capability.

A significant benefit is the fact that everything I’ve described so far is entirely automated. All you as a blogger need to do is a single one time installation of the plugin and within about an hour your entire archive will be covered. This level of automation is again, to the best of my knowledge, unprecedented.

WPG: How does the widget promote engagement time and reduce bounce rate?

Mike: The widget reduces your reader’s incentive to browse away by letting them access all the related content they need right on top of your pages. Why go somewhere else when you have everything you need right where you are?

In your interview with Lior Haner from Yedda you asked, quite rightly, how Yedda was solving bloggers’ need to have conversations take place in their blog. We don’t deal in conversations, however as far as complementary and related content is concerned, we’ve pretty much guaranteed bloggers that their audience won’t have to open another tab or browse away to get the little extra that was missing.

WPG: Can bloggers contact you with questions?

Mike: For sure! I’m personally available for any support needed both on twitter @headup and via email – miked[at]semantinet[dot]com. Don’t be Shy!

WPG: Anything else you’d care to add?

Mike: I agree that Cookies and Cream is Ben & Jerry’s best flavor.

WPG: Of course you do! That’s why we’re pals.

So there you have it. I’d love it if you, our readers, would check out this new feature here and tell me what you think: is it useful, annoying, or somewhere in between?

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How to Change Permalink Structure in WordPress without Duplicate Content

October 14, 2009 – 4:19 pm | by Rebecca Markowitz

Recently we had a client who wanted to change their Permalink structure from

Old Permalink structure: /%author%/%category%/%postname%/

to:

New Permalink structure: /%author%/%category%/%postname%/%post_id%/

so that they would qualify for Google News. Apparently you need at least 3 digits in your URL in order to qualify for Google News.

I wanted to simply change the Permalink structure by going to Settings>Permalinks in WordPress. However, the problem is that Google sees 2 URLs for the same post which could cause Google to penalize you for duplicate content:

Google would see both the old and new Permalink structure for the same content:

For example, Google would see:

(old) http://example.com/Rebecca/News/MyPost/

and

(new) http://example.com/Rebecca/News/MyPost/222

So we need to make sure the old Permalink structure has a 301 redirect to the new Permalink structure.

Thankfully, after trying many plugins, we finally found and successfully implemented this plugin: Permalink Redirect WordPress Plugin

The directions on the site are very old and quite confusing.

Here’s how to use Permalink Redirect WordPress Plugin

  1. Download, Install and activate the plugin
  2. Go to Settings>Permalinks and copy down your old permalink structure
  3. While you’re in Settings>Permalinks, change the Permalink structure to your new permalink structure
  4. Go to Settings>Permalink Redirect and where it says “Old Permalink Structures”, paste in your old permalink structure

That’s it.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How to list the 4 latest posts with only one post per author in WordPress

September 14, 2009 – 3:05 pm | by Rebecca Markowitz

Recently, one site we were working on needed a sidebar that would show the 4 most recent posts on the site. But here’s the catch: they wanted only one post per author. And, each author had to have the role of “author” as opposed to contributor or admin.

The site in question is still in Beta, so I can’t give out the link yet. But here’s a snapshot to give you a better idea of what we were going for.

wpgblogs

We also used the plugin User Photo to show each author’s thumbnail, which I have come to love and recommend.

Thanks to Mark Kaplun for this great solution:

Open your Sidebar.php file and add the following:

Please note: this code uses the plugin Limit Posts to create excerpts. But you can substitute that snippet with any type of excerpt code.

<?php $authors = get_users_of_blog(); ?>

<?php
$latest_posts = array();
foreach ( $authors as $author ) {
$user = new WP_User( $author->ID );
if ($user->has_cap(‘level_7′))
continue;
$ps = get_posts(‘numberposts=1&post_type=post&author=’ . $author->ID . ‘&cat=-9,-3′);
foreach ($ps as $p) {
$latest_posts[$p->post_date] = $p;
}
}
krsort($latest_posts);
?>
<?php //query_posts(‘author=’ . $author->ID . ‘&showposts=1&cat=-9,-3′); ?>
<?php
$counter =0;
foreach ($latest_posts as $post) {
$counter++;
if ($counter > 4)
break;
setup_postdata($post);
?>

<?php // while (have_posts()) : the_post(); ?>

<li>
<?php userphoto_the_author_thumbnail(); ?>
<span class=”blogauthor”> <?php the_author_posts_link(); ?> </span>
<div class=”blog”>    <a title=”Permanent Link to <?php the_title(); ?>” href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?></a></div>
<br />

<?php  the_content_limit(‘55,read more’); ?> <strong><a title=”Permanent Link to <?php the_title(); ?>” href=”<?php the_permalink() ?>”>Read more</a>   </strong>
</li>
<?php } ?>

<?php // }; ?>

The End. Yay code!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How to Customize Multiple Search Result Pages in Wordpress

July 23, 2009 – 9:26 am | by Rebecca Markowitz

In the previous post, we discussed how to hack the search function in Wordpress to have an additional search form that would search  subcategories. Now that you have 2 or more search forms on your site, you might need to customize the search results. Thanks to this solution, I learned how to create multiple search result pages.

Let’s say we have 2 search forms on our site:

  1. General Site-Wide Search
  2. Recipe Search – searches subcategories of the Recipe Category

The first thing we need to do is tweak the search.php template to use it as a filter that will recognize if a search is coming from the Site-Wide search form or the Recipe Search form.

1. Open Search.php and delete everything.  Add the following code:

<?php
/* Template Name: Search Results */
$search_refer = $_GET["site_section"];
if ($search_refer == ‘recipe’) { load_template(TEMPLATEPATH . ‘/recipe-search.php’); }
elseif ($search_refer == ’site-search’) { load_template(TEMPLATEPATH . ‘/site-search.php’); }; ?>

2. Open Header.php or wherever the General Site-Wide Search Form is located and add this line:

<input type=”hidden” name=”site_section” value=”site-search” />

The Site-Wide Search form will look something like this:

<form method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>/”>
<div id=”search”>
<input type=”text” value=” ” onclick=”this.value=”;” name=”s” id=”s” />
<input type=”hidden” name=”site_section” value=”site-search” />

<input name=”" type=”image” src=”<?php bloginfo(’stylesheet_directory’); ?>/styles/<?php echo “$style_path”; ?>/search.gif” value=”Go” />
</div><!–/search –>
</form>

3. Open Recipes.php or wherever your second search is and insert this line:

<input type=”hidden” name=”site_section” value=”recipe” />

You can change the value “recipe” to whatever suits your needs. Just make sure it matches the value in search.php.

The Recipe Search form for your second search will look something like this. In my case, this second search is meant to search the subcategories of the Recipe category.  See my previous post to learn about hacking the search function to search subcategories.

<form method=”get” id=”rsearchform” action=”<?php bloginfo(‘home’); ?>/”>
<div id=”rsearch”>
<input type=”text” value=”Recipe Search… ” onclick=”this.value=”;” name=”s” id=”rs” />
<?php $categories = get_categories(‘child_of=11′);
$catlist = ”;
foreach ($categories as $cat) {
$catlist.= $cat->cat_ID.’,';
}
$catlist.’11′;
?>
<input type=”hidden” name=”cat” value=”<?php echo “$catlist”?>” />
<input type=”hidden” name=”site_section” value=”recipe” />
<input name=”" type=”image” src=”<?php bloginfo(’stylesheet_directory’); ?>/styles/<?php echo “$style_path”; ?>/search.gif” value=”Go” />
</div><!–/search –>
</form>

4. Customize the Search Results Templates

If you recall, in step 1, we added the following to the search.php page.

if ($search_refer == ‘recipe’) { load_template(TEMPLATEPATH . ‘/recipe-search.php’); }
elseif ($search_refer == ’site-search’) { load_template(TEMPLATEPATH . ‘/site-search.php’); }; ?>

Create recipe-search.php (or whatever you named this template) and customize the layout of the results page to your liking. You can use index.php to start with and customize from there.

Create site-search.php (or whatever you named this template) and customize the layout of the results page to your liking. You can use index.php to start with and customize from there.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

New WordPress mailing list for asking and answering WordPress development questions

July 21, 2009 – 1:40 pm | by Miriam Schwab

Where can you go if you have questions about developing and managing a WordPress site? Well, we all know about the WordPress Forums, which can be a useful resource for getting experts and WordPress staff to answer your questions.

However, not everybody is a fan of the forum format – including me. You have to remember to check back (yes, I know there are RSS feeds, but I don’t even go into my RSS reader on a daily basis anymore), and only people who keep an eye on new topics see your questions.

My experience is that mailing lists work great since everybody on the list sees the emails, and good conversations can ensue. Also, users are encouraged to answer questions because it gives them the opportunity to showcase their expertise.

Apparently, there are quite a lot of people who prefer mailing lists, and over the last year or so the WP-Pro mailing list has been getting quite a lot of posts about how to do certain things with WordPress. That would be great if the purpose of the list was for community support – but it’s not! The WP-Pro list is for people who are searching for WordPress service providers to work with, i.e. if you want to pay someone to fix/build/advise your WordPress project, that’s the place to go. If you want to know what the best WordPress SEO plugin is…well, the only place to turn to was the forum.

WP Garage Mailing List – An Online/Email WordPress Community

Not any more! I have set up a mailing list/email group called WP Garage (well, I couldn’t think of another name!), for just these types of questions – if you are looking for plugins, code hacks, tips or just plain ol’ WordPress advice, this new list is for you! The goal is to provide an open and accepting place for WordPress users of all levels to ask and answer WordPress related questions. In the beginning, I will be moderating the posts to make sure no garbage gets through, but if I see that things are pretty clean I’ll ease up on the moderation.

So please come join us, either by clicking on this link or by entering your email address in the field below:

Subscribe to WP Garage Mailing List

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Studio Press Premium Themes