Pages & Subpages – Is Parent?

WordPress allows to create sub-pages in your backend. This is why many uses WordPress as a CMS. Sometimes you like with the help of the Conditional Tags to start several queries with a certain respond – but then you see frequently in the template static queries on any ID of a page.
But it's possible to handle this differently, and simpler when it comes to pages or sub-pages of this page.

With this solution you can, for example, in dependence of a page, load a specific layout. This small request I'll take as an example and show a function that gives queries to pages / sub-pages and I will show an example in action.
Continue reading …

Filter caption-Shortcode in WordPress

The title may not speak for itself and therefore I will explain a little more on the topic and do not just put a code snippets on this post.

If you use the „Mediauploader“ in WordPress not just to load images, but also for integration in the post or page, then a Shortcode will be created and be insert in the content if you leave a picture title for this picture. The title should be maintained, because it will be used as alt-attribute to the img-Tag.

Not every user is satisfied with this issue and I'll show, how you can change the output.
Continue reading …

rel=”canonical”-URL for WordPress Theme

Duplicate content is always an issue in search engines, especially in the context of content management systems and blogging applications. Therefore, they decided together (Google, Yahoo and Microsoft) for a notice using the link tag.

In essence, provides the tag with the rel attribute canonical only a reference to the preferred URL. Once again a new discussion started in the WP Hacker List about this new possibility, which I can not understand. WordPress offers plenty of opportunities so that this form is not necessary to be included in the core, there is sufficiently different and more important topics and the content of a theme should be broadly still lie with the developer. I will show you in this post a simple and quick way to integrate the attribute.
Continue reading …

Change your WordPress Theme on Dependency

WordPress is sometimes not only in use as a blog platform, also as CMS application or for a presentation of photos or other purposes. Many times you like to have a different design depending on the purpose of your WordPress blog within your website. Thus, most of the photo blogs having a different design than the weblog.

In fact you can achieve that quite easily and do not always need to create an extensive query in your template or even a different installation of WordPress setup. You can also deal with the following solution, giving you a better overview of the separate themes. With this solution you have many possibilities to implement individual designs.
Continue reading …

Numbering your comments, pingbacks, trackbacks or all

Since WordPress 2.7 exists an API for the comment area. Thereby you can purge the PHP-portion within comments.php. Jean-Baptiste shows a simple solution to count comments. This solution is very well known and get used pretty much since the first release of WordPress. But if you like to have a filter, which counts only the trackbacks or only the comments, then this solutions is worthless. Besides that, the How To is pretty poor and PHP-rookies could have troubles with it.

Relating to this and because of many questions about this topic I show you two simple functions, which you insert in your functions.php of your theme. Normally they get used as output in your comments.php.
Continue reading …