Categories
PHP WordPress

Add dynamic version number to WordPress themes style.css

Prevent browsers using old cached styles by automatically adding file modification time as your themes style.css version number

Categories
PHP WordPress

Remove extra 10 pixel space from WordPress caption

WordPress adds extra 10 pixels to captions with inline styles. To get rid of the unwanted space add following snippet to your themes functions.php

Categories
PHP WordPress

Get page link from title in WordPress

Categories
PHP WordPress

Dequeue WMPL language-selector.css

WPML does not use wp_enqueue_style, but there is constant for language selector to prevent loading of the styles. Add following snippet to your functions.php.

Read more about WPML constants and functions

Categories
PHP WordPress

Add category support to WordPress pages

Category support for pages can be added with register_taxonomy_for_object_type() function. Add following example to your functions.php.

Categories
PHP WordPress

Display caption with post thumbnail in WordPress

 

Categories
PHP WordPress

Remove automatically inserted paragraph tags from Contact Form 7

Add following line to your wp-config.php

 

Categories
PHP WordPress

Exclude pages from WordPress search

To exclude page from search, add following code to your theme’s functions.php.

Exclude page and all it’s child pages from search.

Categories
PHP WordPress

Add excerpt support to pages in WordPress

Add following code to your themes functions.php file.

Categories
PHP WordPress

Create additional image sizes in WordPress

Register additional image sizes

Additional image sizes can be defined in your themes functions.php. In example

Full documentation can be found at WordPress Codex

Displaying additional image sizes in your theme

Previously upload images do not have the new image size. Images can be generated with Regenerate Thumbnails plugin