Browsed by
Tag: wordpress

Exclude pages from search results in WordPress

Exclude pages from search results in WordPress

My blog has a Mac section. This Mac section is a page with one article which contains all the software. When someone uses the search functionality from this blog, and searches for VPN the whole Mac section appears in the search results which is pretty annoying. This website explains how to exclude all pages from the search results.

  1. Open your WordPress admin
  2. Goto Appearance
  3. Click on Editor in the Appearance menu
  4. On the right side of the pages click on theme functions
  5. Add the following code to this section
function vibeExcludePages($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','vibeExcludePages');
Custom WordPress theme tutorial

Custom WordPress theme tutorial

I was looking into custom WordPress theme tutorials when a friend of mine pointed out this tutorial. It is very well written and covers the following topics:

  • Creating a Theme HTML Structure
  • Template and Directory Structure
  • The Header Template
  • The Index Template
  • The Single Post, Post Attachment, & 404 Templates
  • The Comments Template
  • The Search Template & The Page Template
  • The Archive, Author, Category & Tags Template
  • The Sidebar Template
  • Reset-Rebuild Theme CSS & Define Your Layouts

Quite complete, and definitely enough to get started in developing your own WordPress themes.

Remove “An automated WordPress update has failed to complete” message

Remove “An automated WordPress update has failed to complete” message

This weekend I tried to autoupdate my blog to WordPress 2.8. This failed for some still unknown reason. Since this fail I was stuck with the following message in my admin page: “An automated WordPress update has failed to complete”.

I decided to update WordPress manually but the message kept in place. It turned out that I needed to remove a file called “.maintenance” from the website root directory. Finally the message disappeared 🙂

Picture 4

Code in WordPress

Code in WordPress

In one of my posts I had a nasty problem which took me a while to find out a solution. The problem was with having two dashes next to each other in an Linux command where I was writing about. Even though I wrote two dashes, WordPress made it appearing as one.

Code button in the toolbar
Code button in the toolbar

Read More Read More

Page Links To plugin for WordPress

Page Links To plugin for WordPress

As you can see this blog has several subpages like photography and about. My problem was to have a page linked to an external website. Therefore I used:

<script type=”text/javascript”><!–
window.location = “http://flickr.com/basvandijk”
// –></script>

Now it turned out, there is a WordPress plugin available called “Page Links To” When enabled it provides you the option to have a page linked to an external website of your choice. Works a lot better than using Javascript redirects 😉

Page Links To field
Page Links To field
Permalinks with ISAPI rewrite for WordPress

Permalinks with ISAPI rewrite for WordPress

When I started this blog I wanted to have nice looking permalinks for all articles. This means all articles have links like:

http://www.basvandijk.eu/2009/01/01/happy-new-year/

instead of

http://www.basvandijk.eu/?id=3458

I almost got this working except the fact that my URLs contained “index.php” like:

http://www.basvandijk.eu/index.php/2009/01/01/happy-new-year/

After searching through lots of websites I found a solution for this issue.

Read More Read More