Google Answers Logo
View Question
 
Q: Wordpress problem. Lose right sidebar on Single posts only. ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Wordpress problem. Lose right sidebar on Single posts only.
Category: Computers > Internet
Asked by: cashbagg-ga
List Price: $25.00
Posted: 13 Jun 2006 19:32 PDT
Expires: 13 Jul 2006 19:32 PDT
Question ID: 737952
I downloaded and customized a Wordpress theme. After doing so, and
having site look pretty much the way I wanted, I noticed that on
SINGLE posts, I lose my right sidebar. I looked at my single.php file,
and sure enough I have the following: <?php get_sidebar(); ?> so I
don't see why it only shows the left sidebar, not the right in single
posts. I have replaced <?php get_sidebar(); ?>
with <?php include('sidebar.php'); ?> with no results. I am really
stumed here. Wordpress expert needed. My site is www.hornyoyster.com

Request for Question Clarification by eiffel-ga on 14 Jun 2006 01:47 PDT
Hi cashbagg.ga,

To help debug your Wordpress theme we would need to be able to see at
least the following theme files: index.php, single.php and
sidebar.php. Without those, we can see only the generated HTML files,
which shows that there is no content on the right sidebar but doesn't
show why.

Can you post those files somewhere, then post the URL here? As a last
resort, you could post them directly into the "Clarification" box (one
file per clarification please) but this will not be ideal because of
line-wrapping.

Also, you may wish to consider amending the price for your question. A
researcher may need to invest considerable time into this question.

Regards,
eiffel-ga

Clarification of Question by cashbagg-ga on 14 Jun 2006 05:35 PDT
Here are my codes:

style.css - http://pastebin.com/708354
sidebar.php - http://pastebin.com/708355
single.php - http://pastebin.com/708356
index.php - http://pastebin.com/708358

Clarification of Question by cashbagg-ga on 14 Jun 2006 05:38 PDT
One other annoyance I forgot.

On the left sidebar, if viewing in IE, the LINKS section content is
off-center, and too low. Can this be centered?

Thx.
Answer  
Subject: Re: Wordpress problem. Lose right sidebar on Single posts only.
Answered By: eiffel-ga on 14 Jun 2006 09:11 PDT
Rated:5 out of 5 stars
 
Hi cashbagg-ga,

Thanks for posting the additional files. I think I've found the source
of the problem.

Line 156 of sidebar.php includes the following code:

   ... if ( is_home() || is_page() ) ...

Because of this, the right-hand sidebar (<div id="sidebar2">) is only
displayed on the home page and on your "Info" pages. Try changing this
to

   ... if ( is_home() || is_page() || is_single() ) ...

I expect this will make the right-hand sidebar appear on single-post pages.

Regarding your additional question about the LINKS section: I use
Linux and cannot try it out using IE. However, here is the source of
your problem:

All WordPress links are held within a Link Category (such as
"Blogroll" or "Links"). You have used WordPress Admin to change the
Link Category name to blanks. But when WordPress generates the page,
it is generating an empty <H2> header tag to hold this blank link
category name, and it is indenting the links horizontally under where
the link category name would be.

You could probably fix the horizontal alignment by removing the <ul>
and </ul> tags on lines 95 and 99 of sidebar.php. If this still leaves
a vertical alignment problem due to the empty <H2> link category
heading, you will need to use another WordPress template tag instead
of get_links_list().

Try this: Put back the <ul> and </ul> tags on lines 95 and 99 of
sidebar.php (if you removed them earlier). Then change line 99 to
read:

  <?php wp_get_links(1); ?>

(I am assuming your links are under Link Category 1. Go to WordPress
Admin, Links, Link Categories and check that the ID is 1. If not, use
that ID instead of 1 in the above line of code.)

This should get rid of the spurious <H2> heading for the blank link
category, but some layout tweaking might still be needed. Let me know
how you are going...

Regards,
eiffel-ga


Additional Links:

WordPress documentation for the wp_get_links() Template Tag:
http://codex.wordpress.org/Template_Tags/wp_get_links

WordPress documentation for the get_links_list() Template Tag:
http://codex.wordpress.org/Template_Tags/get_links_list
cashbagg-ga rated this answer:5 out of 5 stars
Great thx, the main issue (missing sidebar) was my main concern, and
that is fixed thanks to your help. I got the horizontal alignment
fixed, vertical is still a bit low, but it's really insignificant to
me at this point. Thx for the great help!!!!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy