Does this code make sense?

General questions pertaining to how certain issues can be resolved
Forum rules
1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"

Does this code make sense?

Postby newbie2012 » 23 Apr 2012, 16:58

Hi,

I'm trying to display certain information between the <head></head> tag for only one page on my website . I tried the following but I get a blank white screen for all my pages now. Any help would be really appreciated.

Thank you.

Code: Select all
<?php
/**
 * Core header file, invoked by the get_header() function
 *
 * @package Suffusion
 * @subpackage Templates
 */

if (is_page(1194)) {

<head>

// PUT ALL THE INFORMATION THAT I WANT TO APPEAR BETWEEN THE HEAD TAG FOR PAGE 1194

wp_head();

</head>

}

else {

// PUT EVERYTHING ELSE THAT WAS ORIGINALLY IN THE HEADER.PHP FILE

}
Last edited by newbie2012 on 24 Apr 2012, 09:22, edited 1 time in total.
newbie2012
 
Posts: 7
Joined: 24 Feb 2012, 19:21

Re: Does this code make sense?

Postby Colin » 23 Apr 2012, 23:04

It won't work with this code.

Revert to standard Suffusion.

Add a widget area where you want it and put a text or php widget in that area to hold whatever you want. THEN get the Widget Logic plug-in and make that widget area visible only on the page that you want. Much easier and keeps Suffusion standard.
Colin
 
Posts: 2797
Joined: 27 Oct 2009, 10:46

Re: Does this code make sense?

Postby newbie2012 » 24 Apr 2012, 18:30

Hey Colin,

Appreciate the advice.

Maybe if I try to explain what I'm doing you may have another suggestion.

I need to create a custom page template that just has my content and a few lines in the head tag. Really, I would just want the source code to look like this:

Code: Select all
<HTML>

<HEAD>
// THE INFORMATION I WANT TO APPEAR
</HEAD>

<BODY>
// MY CONTENT
</BODY>

</HTML>


The reason for this is that I'm using it display a page on my site in a tooltip. If I use the get_header() function and hover over a link to show my tooltip it messes up the sidebar styling (not to mention it takes a lot longer to load the page in the tooltip).

Your help would be greatly appreciated.
newbie2012
 
Posts: 7
Joined: 24 Feb 2012, 19:21

Re: Does this code make sense?

Postby sayontan » 24 Apr 2012, 19:01

This is a PHP question rather than a WP question. You cannot mix HTML syntax in PHP code. Every place you are including PHP it has to be between <?php and ?>. Conversely you cannot have raw HTML within these tags. In your code you need ?> after the first {. You will also need to close wp_head in php code etc.
Sayontan Sinha | http://mynethome.net/blog | http://www.aquoid.com/news
I don't do freelance work (for Suffusion or otherwise), so please don't contact me for quotes or offers.
sayontan
Site Admin
 
Posts: 10159
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas


Return to Support Requests

Who is online

Users browsing this forum: Baorrarra, dymnluldefe, Thomas F, Vasanthan, vvpcbfjc and 7 guests