• abasey

    (@abasey)


    Hi,

    I manage fitprowest.com and I have an example page here: here with testimonials that was setup by a previous admin. I would like to do the same thing to this page https://www.fitprowest.com/shayne-jansen-2/ but I cannot get the sidebar to show up.

    I am trying to do the same thing by creating a side bar and then adding a text widget to that side bar and then telling the post page to replace the default sidebar with my created sidebar that contains the widget of text. I cant get it to show up.

    Thoughts?

    Thanks,
    abasey

Viewing 1 replies (of 1 total)
  • redrambles

    (@redrambles)

    Hey there,

    So your links above show two single post pages – one for Dan – with it’s own widgetized sidebar, and one for Shayne – for whom you would like ‘his’ specific sidebar with content that relates to him (perhaps his own testimonials or something similar?) I hope I understood you correctly!

    To achieve this, you could create a new sidebar file (say – sidebar-shayne.php) and then call it conditionally in your single.php file (which is responsible for loading single post pages).

    You would have to find out ‘Shayne’s’ page ID. Once you have it, (let’s pretend the id is 1), you would write something like this in your single.php:

    if ( $post->ID == 1 ) {
    	get_sidebar( 'shayne' );
    }
    else {
     	get_sidebar();
    }

    This way – whenever the single post with the ID of 1 is pulled up, what you have in sidebar-shayne.php would be displayed. If you want this sidebar to be ‘widgetized’ – so you can go ahead and drag and drop widgets into it via the dashboard like with your other sidebar(s) (rather than writing the code directly in sidebar-shayne.php, for example), you will have to register it in functions.php and then call it in your sidebar-shayne.php template file.

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Sidebar not showing on Post page’ is closed to new replies.