Prevent browsers using old cached styles by automatically adding file modification time as your themes style.css version number
Category: PHP
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
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
Category support for pages can be added with register_taxonomy_for_object_type()
function. Add following example to your functions.php.
<figure> <?php the_post_thumbnail(); $caption = get_post( get_post_thumbnail_id() )->post_excerpt; if ( $caption != "" ): ?> <figcaption> <?php echo $caption; ?> </figcaption> <?php endif; ?> </figure>
Add following line to your wp-config.php
define( 'WPCF7_AUTOP', false );
To exclude page from search, add following code to your theme’s functions.php.
Exclude page and all it’s child pages from search.
For WPML 3.2+ correct version for translating permalinks is
Documentation for wpml_object_id
For versions older than 3.2 you can use version below
Parameters for icl_object_id
are:
- Term id for taxonomies, post id for posts and pages
- Element type ie. comment, post or page
- Return original value if translation is missing. Defaults to true
- Language code, if missing will use the current language.