• Resolved emaarkhan

    (@emaarkhan)


    Hi,
    I m using custom template for my pages which has same code as index.php it shows the right sidebar but not all of its content. i tried to tally them. both pages has exact same code, but its not showing full right sidebar. wht could be the reason?
    this is the code

    <div class=”rBar”>
    <?php dynamic_sidebar(‘my-sidebar’); ?>
    </div>

    it shows only one widget, not the others but in index.php it shows every widget.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Try looking at the sidebar template file.

    Thread Starter emaarkhan

    (@emaarkhan)

    what do u mean? I did not understand

    You need to look at your theme’s sidebar template file.

    Thread Starter emaarkhan

    (@emaarkhan)

    Sorry i m a n00b/new at WordPress. what should i look for in sidebar template file?

    Any code that might limit the sidebar’s display on anything but a site’s home page.

    Thread Starter emaarkhan

    (@emaarkhan)

    No there isn’t anything like that there. should i paste u its code.

    If it is longer than 10 lines, please use a WordPress pastebin and post the pastebin url here.

    Thread Starter emaarkhan

    (@emaarkhan)

    The right sidebar doesn’t have code in sidebar template file. i just copy function of sidebar for right side and pasted it in functions file. here is the function

    function add_my_sidebars(){
    	register_sidebar( array(
    		'name' => 'My sidebar',
    		'id' => 'my-sidebar',
    		'description' => 'Right Sidebar',
    		'before_widget' => '<div id="%1$s" class="widget-container %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h6 class="widget-title">',
    		'after_title' => '</h6>',
    	) );
    } add_action('widgets_init', 'add_my_sidebars');

    and its call is in index.php

    <div class="rBar">
    <?php dynamic_sidebar('my-sidebar'); ?>
    </div>

    Do i still need to paste the sidebar template code?

    [Please post code or markup snippets between backticks or use the code button.]

    The right sidebar doesn’t have code in sidebar template file.

    Uh? Do you have a sidebar template file for this sidebar. It’s apparently called sidebar-my-sidebar.php.

    Thread Starter emaarkhan

    (@emaarkhan)

    Sorry my mistake, what i meant was the right sidebar code isn’t in sidebar. the WordPress Pastebin doesn’t work (the link is broken) so i am posting the code of sidebar code here

    [Code moderated as per the Forum Rules. Please use the pastebin. The link works just fine.]

    Thread Starter emaarkhan

    (@emaarkhan)

    Hi the pastebin link says ‘server not found’, what should i do?

    It’s working fine for me but you could always try looking for another free paste bin.

    Thread Starter emaarkhan

    (@emaarkhan)

    Ah ok, here is the code of sidebar.php

    Thread Starter emaarkhan

    (@emaarkhan)

    I seen the theme i started working on was a blank theme and was a mess to handle. so i restarted doing work on child theme. but thanks for ur help!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Template doesn't show some content’ is closed to new replies.