Title Attribute for Post Thumbnail
The ‘featured image’ in WordPress automatically outputs the image alt attribute, but no title attribute. Those two attributes are used for different reasons: – the alt attribute is used to output...
View ArticleComments on the ‘Posts Page’ in WordPress
If you are using a static home page and have set one of your other pages to be the ‘posts page‘ [Codex], then there is no direct way to allow comments on that page. You will need to do some custom...
View ArticleTag Cloud Filter to Show Current Tags
Wouldn’t it be nice to see the current tags reflected in the tag cloud widget? WordPress does not output any css classes for the current tags – as it would do for instance in the category or page menu....
View ArticleIntegrate Pagination Plugins into Twenty Twelve
The ‘next/prev’ posts links are done with a function in Twenty Twelve; twentytwelve_content_nav(). That function is pluggable, which makes it easy to change it in a child theme of Twenty Twelve. To...
View ArticleLinking or Enqueuing Stylesheet in WordPress Themes
There are several ways of adding a stylesheet to a WordPress theme; examples: A: linking the stylesheet (in the head section of header.php) – linking the main stylesheet style.css: <link...
View ArticleWordPress Changing Pluggable Functions Without Child Theme
A new concept (?) – to change a pluggable function of a WordPress theme without creating a child theme. Example – to remove the post tags output from the posts of Twenty Twelve. Often, these things...
View ArticleAlphabetize Category Posts Using ‘pre_get_posts’ Action
Occasionally you want to have a different sort order in some of the category archives, for example, you want to output the posts of a specific category in alphabetical order. Instead of having to...
View ArticleFeatured Image in Header of Archive Pages in Twenty Eleven
To show the ‘featured image’ of the top post as header image in an archive page in the Twenty Eleven theme, edit header.php in the child theme; change this section: <?php /* * The header image. *...
View ArticleA Real ‘Full Width Page’ Template for Twenty Fourteen
To create a real full width page – with no sidebars whatsoever – in your WordPress site while using a child theme of the default theme Twenty Fourteen, program this page template file with the file...
View ArticleInjecting Multiple adsense Ads into a WordPress Loop
The versatile code injects for instance adsense ad codes several times into the posts of an index or archive page, starting with a pre-set post, and then repeated in regular intervals (up to a set...
View ArticleBetter Gallery Alignment in Twenty Seventeen
The new theme Twenty Seventeen shows the right thumbnail image in the default 3-column gallery with just a little space to its right, which is particular noticable when you post a full width image...
View ArticleShow Custom Site Title or Tagline per Page
to have a custom site title and/or tagline on different pages (static pages only) of your WordPress site; one possible approach: /* * customize different Site Title * and Tagline per (static) page */...
View Article