March 2020
Beginner
660 pages
18h 28m
English
In this scenario, we used WordPress' the_content filter. This filter is used to pass the content of posts and pages and make the necessary modifications. We can add this filter to the functions.php file of the theme to change its content based on different conditions. Consider the following lines:
if( is_single() ){ $content .= "<p>Additional Content for single post </p>";}else if( is_archive() ){ $content .= "<p>Archive Page Content for each post </p>";}
Let's assume we want to show additional content on a detailed post page and hide it on archive pages. Usually, this is used to let users get more content by visiting the detailed post instead of just looking at archive page content ...
Read now
Unlock full access