Wordpress Hooks:
Wordpress Hooks are used to create themes or plugins without change the wordpress core files.
There are two types of hooks:
Action hooks: Action hooks are used to insert an additional code from an outside resource.
Filter hooks: Filter hooks are used to add content or text at the end of the post.
If You want to insert content after Each Post, You need to create the function in the functions.php file of your theme.
function insertContent($content) {
if(!is_feed() && !is_home()) {
$content.= "<div class='content'>";
$content.= "<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>";
$content.= "</div>";
}
return $content;
}
add_filter ('the_content', 'insertContent');
Wordpress Hooks are used to create themes or plugins without change the wordpress core files.
There are two types of hooks:
Action hooks: Action hooks are used to insert an additional code from an outside resource.
Filter hooks: Filter hooks are used to add content or text at the end of the post.
If You want to insert content after Each Post, You need to create the function in the functions.php file of your theme.
function insertContent($content) {
if(!is_feed() && !is_home()) {
$content.= "<div class='content'>";
$content.= "<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>";
$content.= "</div>";
}
return $content;
}
add_filter ('the_content', 'insertContent');

No comments:
Post a Comment