A hook, named
wp_head
, that runs just before the </head>
tag is present in most themes, so we can just set our function to run wheneverwp_head
runs, like so:add_action("wp_head", "awepop_add_view")
Example
The filter img_caption_shortcode is applied in media.php using the following call:
// Allow plugins/themes to override the default caption template. $output = apply_filters('img_caption_shortcode', '', $attr, $content); if ( $output != '' ) return $output;
The target filter function will be called with three arguments:
- '' <= This is normally the value the filter will be modifying
- $attr
- $content
/////////////////////
- archive-{post_type}.php
- single-{post_type}.php
- archive-{post_type}.php
- If your custom post type were 'product', and/or query_var = "product", WordPress would look for archive-product.php to display the archive of posts.
- single-{post_type}.php
- If your custom post type were 'product', and/or query_var = "product", WordPress would look for single-product.php to display the single or permalink of the post.
If these files are not available in your Theme's directory WordPress will look for archive.php and single.php, respectively. If even these files are not present it will default to index.php.
/////////////////
comments_template( '', true ); //pour afficher les commentaires et le plugin de facebook comment
into single-post
Aucun commentaire:
Enregistrer un commentaire