Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved <Head> Code For Individual Pages (Embedding Bing Maps)


Question

Posted · Report post

Hi,

Forgive me if this has been asked before, I did have a search but didn't come up with anything. Is there any way to embed header code just for one specific page?

I'm looking to embed a Bing map which requires code in the head section as well as the body but obviously I won't need that map on every single page. I believe that if I add it to the Custom Code section then it will go into every page on the site which seems like a bad idea.

Bing Map Code: http://msdn.microsoft.com/en-us/library/gg427608.aspx

I'm sure there's an established alternative method for getting the code in there on Pagelines but I'm afraid I've not found it yet.

Thanks in advance to anyone who can point me in the right direction,

Blue Squirrel ;)

[Hope the topic tags will help people in the future with the same question!]

Share this post


Link to post
Share on other sites

6 answers to this question

Posted · Report post

Hi there, I've checked this for you and I've been told that unfortunately this isn't possible. The only way to add the header script is via the custom code page in the header scripts box, which will be site-wide.

Share this post


Link to post
Share on other sites

Posted · Report post

Oh dear, that's not very good.

On the other hand I'm glad I asked a question that didn't have an obvious answer.

Share this post


Link to post
Share on other sites

Posted · Report post

James is right. There is no way to add head code to individual pages. The head is global, meaning that it is the same on all pages, so naturally the code that is put in it will be working on all pages.

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

I'm not sure I'd say it's resolved, it doesn't seem like a satisfactory resolution.

Maybe the forum should include an option for [CLOSED] to show threads that weren't resolved?

Share this post


Link to post
Share on other sites

Posted · Report post

Just seen this post,




 

<?php
add_action( 'wp_head', 'my_header_stuffs' );
function my_header_stuffs() {
if( is_page( 128 ) {

?>
<!-- html start...

html ends -->
<?php
}
}
 

 



add to customize plugins functions.php change 128 to your page_id

Share this post


Link to post
Share on other sites