• Hi all
    I am wanting to call for a different sidebar on the page.php different to the one called for on the index and single page.

    I have put <?php get_sidebar ('custom'); ?> on the page.php and then added this to the functions.php

    <?php if ( function_exists ('register_sidebar')) {
        register_sidebar ('custom');
    } ?>

    however I then get an error message when I try to view the site saying:
    Parse error: syntax error, unexpected '<' in /home/emotiona/public_html/test/wp-content/themes/twentyten 2/functions.php on line 366

    thanks for any help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Paste these code in the functions.php after the if statement

    if ( function_exists('register_sidebar') )
        register_sidebar(array(
        	'name'=>'Custom-Sidebar',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '',
            'after_title' => '',
        ));

    Create a php page sidebar-custom.php and paste the following code

    <?php
    	if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Custom-Sidebar') ) : ?>
    		<?php wp_list_categories('title_li=' . __('Categories:')); ?>
    
    <?php endif; ?>

    Now call in any of the page where you want the sidebar to appear.
    <?php get_sidebar('custom'); ?>

    Thread Starter grishart

    (@grishart)

    Thats worked a treat.

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to call for a different sidebar on page.php’ is closed to new replies.