How do I add a button that would appear only within an article?


I want to add a back button within an article which I’m able to do but it also shows the back button on main archives page and the additional main news pages. Is there a way I can add a back button to within the article only without it appearing on the archives and main news page? I’m working within the index.php page.


Try wrapping your code in the is_singular block as below

if ( is_singular() ) {  
    //You back button code