Wordpress and Webdesign Forum go41 » WordPress Code Snippets

  1. qtest
    Member

    Hi

    I have made few changes to the structure to the free arthemia theme http://www.energybusiness.in. I've compressed the width of 'Headline' and 'Featured' div's and sidebar starts from top. I've moved the sidebar code above the content in the source code and it is working fine in all browsers except IE 6 where the content is rendered below the sidebar and not alongside. Can someone help me sort this. I am not very good at CSS.

    How can I have a different single.php for a special category (say Data reports)? What I am trying to achieve is I need to list all the attachments within a post page of Data category. Any ideas on this?

    Thanks in Advance. Zafar

    Posted 1 year ago #
  2. there might be something too wide in your sidebar?

    It could be
    #sidebar-left {
    ...
    margin-left:25px;
    ...
    }

    this margin might be to wide, try a lower value or even remove this.

    To get a special single for a certain category I use a switch in single.php

    I replace <?php get_header(); ?> IN SINGLE.PHP with this as example:

    <?php if ( in_category('7') ) { // do not forget closing bracket at end of single.php
    	include 'single-cat-7.php';
    } elseif ( in_category('13') ) {
    	include 'single-cat-13.php';
    } elseif ( in_category('36') ) {
    	include 'single-cat-36.php';
    } else { get_header(); ?>

    AND ALSO ADD THIS BELOW THE LAST LINE OF SINGLE.PHP

    <?php } // end in category switch ?>

    Finally you replaced something on top and on bottom of this file.

    Now, if wordpress looks for a single post (not a page!) it will get single.php first. BUT if this post is in category 7 it will load single-cat-7.php or if in category 13 it loads single-cat-13.php

    This singlexxx.php are just a copy of the normal single.php and can be modified. These singlexxx.php custom files start just with <?php get_header(); ?> as usual, NO SWITCH IN THESE FILES AGAIN..

    Try it, works fine for me, tell me the results pls..

    Posted 1 year ago #
  3. qtest
    Member

    Thanks.

    I'll implement the switch in a couple of days (right now I am working on it) and let u know if I experience any problem.

    I've checked the sidebar and found nothing. I don't think sidebar is a problem bcoz within IE6 itself, I get all other pages (like category pages) fine except site home page. What I've done is that I have moved < php get_sidebar();> before the headline, featured and frontlist section in the source and I have a feeling its got to do with the float:right attribute for the sidebar section. It is floated to right (IE6 only, rest everywhere is working fine) but is there is no content to the left. The other content starts only after the sidebar.

    Posted 1 year ago #
  4. actually I would not care about IE6, I can't check this problem.
    I can see however that you load the sidebar first, floating right with a width of 320px.
    this follows your div id top which has no width assigned and takes the width of the widest div inside 'top', this is 'bottom', set to 940px. You might have a chance by giving #top a width of about 620px or/and set #bottom also to 620px.

    Not sure however which effect this could have in other browsers and other 'pages', where you load the sidebar after the content.

    For SEO it's better to load the content first and after that the almost static sidebar...

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Join us! or log in (lost password?):