• Resolved georgedumontier

    (@georgedumontier)


    Hello,

    I want to edit the html markup of the article tag on a specific static page. I know I can add some markup through the Edit Page area of the dashboard. But is there a way to hook in and do it from my functions.php page?

    Here’s the site

    Thank you all for the amazing help I’ve received on this forum!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter georgedumontier

    (@georgedumontier)

    I think ‘the_content‘ might be the hook I’m looking for, but is there a way to only apply to it to one specific page?

    Is this something I would use a page template for?

    Thread Starter georgedumontier

    (@georgedumontier)

    Hi George,

    What you’re looking for is a conditional statement. Try this:

    add_action('__before_main_container', 'pec_mtd_filter_content');
    function pec_mtd_filter_content(){
    	if(is_page( 'meet-the-doctors' )){
    		add_filter('the_content','pec_change_mtd_content');
    		function pec_change_mtd_content($stuff){
    			$stuff = 'blablablablabla';
    			return $stuff;
    		}
    	}
    	else{}
    }

    This seems to work, but I’m not totally sure if the syntax is right. It might be a little ugly or stupid looking.

    Next time spend some more time googling your question before you post to the forums!

    Candidate for Post of the Year 2016 ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Edit markup of article tag on static page’ is closed to new replies.