Jump to content
Sign in to follow this  
minute14

Code placement question

Recommended Posts

minute14

I am trying to apply css to posts that have several custom fields. I found this post http://blue-anvil.com/archives/including-css-javascript-in-wordpress-posts-using-custom-fields/ and before I add the code they mention to add it to the header.php file and i had a question. I would be adding it into the Pagelines Admin>Custom Code>Header Scripts and the code they mention is below:

<?php
	if (is_single()) {
	  if ($css = get_post_meta($post->ID, 'custom_css', true)) {
	    echo '';
	  }
	  if ($js = get_post_meta($post->ID, 'custom_js', true)) {
	    echo '';
	  }
	}
	?>

As you see it begins with "<?php" will that cause an issue (crash) adding it into the header scripts section? Thanks! :)

Share this post


Link to post
Share on other sites
catrina

Yes, the headerscripts section is actually for Javascript code and other types of code designated for the header segment of a website, but not for PHP.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×