Forum Replies Created

Viewing 3 replies - 121 through 123 (of 123 total)
  • Thread Starter martiniboy

    (@martiniboy)

    Thanks for your fast response unfortunately because we have reset the query after the main post at the top the subsequent excerpts are not being shown now.

    Thanks anyway

    Thread Starter martiniboy

    (@martiniboy)

    Thanks for replying after all that my initial code worked I just needed to alter a part in the wordpress dashboard. Thanks Cais now I know about the body_class_function it will make future projects easier.
    Except now it has brought me to another problem – when I click on the link on the sidebar it directs me to the page and posts that I want except the sidebar is now empty. Here is the code which I have used in the sidebar.php

    <ul><?php
    		if (get_post_meta($post->ID,'categorynumber', true)) {
            $catid = get_post_meta($post->ID,'categorynumber', true);
    		wp_list_categories("child_of=" .$catid . "&title_li=");
    		}
    ?>
    </ul>

    but now I want to tell it that if it is on a page which is a child category still display the categories of the parent.
    I tried using at the end of the above code

    else {
    	if (in_category ('16,10,5,18'))
    	 wp_list_categories ('parent_of=' .$catid . "&title_li=" );

    but does not work,
    I hope what I am trying to do makes sense
    if not let me know I will explain in more detail
    }

    Thread Starter martiniboy

    (@martiniboy)

    Thanks for your reply I manged to accomplish what I wanted using the page2cat plugin and altering the code in the sidebar.php. Except now it has brought me to another problem – when I click on the link on the sidebar it directs me to the page and posts that I want except the sidebar is now empty. Here is the code which I have used in the sidebar.php.

    <ul><?php
    		if (get_post_meta($post->ID,'categorynumber', true)) {
            $catid = get_post_meta($post->ID,'categorynumber', true);
    		wp_list_categories("child_of=" .$catid . "&title_li=");
    		}
    ?>
    </ul>

    but now I want to tell it that if it is on a page which is a child category still display the categories of the parent.
    I tried using at the end of the above code

    else {
    			if (in_category ('16,10,5,18'))
    			 wp_list_categories ('parent_of=' .$catid . "&title_li=" );
    						   }

    but does not work,
    I hope that this makes sense
    if not let me know I will explain in more detail

Viewing 3 replies - 121 through 123 (of 123 total)