Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

How to add code to head of single page/post?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Apr 11, 2012, 01:57 AM
megavolt
 
17 posts · Mar 2012
How to add code to head of single page/post?

I've been trying to add coding between the <head> and </head> of a single page or post, but I can't figure out how to do this. Can someone help me please?
Thank you
Yoni
  #2  
Old Apr 11, 2012, 02:51 AM
juggledad's Avatar
juggledad
 
22,261 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
What are you trying to add?
You may have to edit header.php and put it there
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Apr 11, 2012, 03:10 AM
megavolt
 
17 posts · Mar 2012
On one page I want to add some JavaScript that I need for a converter that I will have on the page. If I try putting the script in the page (post) itself, it disappears after I move from "html" view to "Visual" view, and back again. I'd rather have it in the head anyhow.
On another page, I need to add css for just that page (mapping a photo). I know that the css can probably be added in the HTML/CSS Inserts, but being a newbie to all this, I don't exactly know how.
Thanks
  #4  
Old Apr 11, 2012, 04:02 AM
juggledad's Avatar
juggledad
 
22,261 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
you are going to have to edit the theme code for the first page. You need to edit header.php and just after line 42 (version 3..3) which is
HTML Code:
<?php wp_head(); ?>
you will add something like
HTML Code:
<?php if (is_page(35)) {.......}; ?>
as for the css, yes put it in the 'CSS Inserts' option, just prefix the CSS selector with 'body.page-id-35' substituting what the page ID is in place ofthe 35.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Apr 11, 2012, 08:14 AM
megavolt
 
17 posts · Mar 2012
Thanks. I'll try my hand at this and let you know if I get it right.
  #6  
Old Apr 11, 2012, 11:36 PM
megavolt
 
17 posts · Mar 2012
I tried putting the JavaScript in the header.php. At first it didn't work, but my son happen to be visiting at the same time. He played around with it a bit, added something, and got it to work. Thanks.

Now there is a very strange thing happening. After I save the post itself, with the form, Wordpress adds <br /> on every line all by itself. This messes up my whole page. I tried encasing my code with <div>, <p>, and whatever else I could think of, but it doesn't help. I even tried putting it in a table (not that I actually thought it would help - more out of desperation), but still nothing. Is there anything I can do about this, short of disabling wpautop? I am using Wordpress 3.3.1.
Thanks

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header & Footer Code for Single Page? GRF Header configuration & styling 2 Sep 15, 2011 09:11 PM
[SOLVED] Hard code a single page menu link to an existing (non-wordpress) website jms5017 Page & Category Menu Bars 4 Aug 3, 2010 04:45 AM
Permalink in single post and single page anup Center area post/pages 0 Jul 15, 2010 09:46 AM
How to add php code to a 'single' page JakeThePeg Center area post/pages 8 Mar 21, 2010 01:21 AM
[SOLVED] Next post and previous post links on top of single post page error susieswe Atahualpa 3 Wordpress theme 2 Jul 15, 2009 02:58 PM


All times are GMT -6. The time now is 05:51 PM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.