• Resolved JCKnoell

    (@jcknoell)


    Okay, so there are a thousand posts just like this one, but I don’t understand any of them, and even though I’ve tried them anyway, they’ve had no effect or they’ve completely broken my site. (even broke the back-end on one of them. Had to use my ftp to fix it.)

    I need to add my blog’s sidebar to my single post pages too. My blog’s <https://beta.cleantelligent.com/blog&gt; sidebar is different from the many other sidebars on my website, but I need the blog sidebar on the single posts. Right now, it’s calling a blank sidebar.

    Thank you. any help would be great.

Viewing 15 replies - 16 through 30 (of 33 total)
  • esmi

    (@esmi)

    Should I be specifying the blog sidebar there?

    Not based on the parent theme, no. The sidebar that is pulled into the main posts page template (index.php) is sidebar.php. So <?php get_sidebar(); ?> should, in theory, be all that you need. How many sidebar files do you have and what are they called?

    esmi

    (@esmi)

    OK – can you list the files in your child theme’s root folder?

    Thread Starter JCKnoell

    (@jcknoell)

    content-archive.php
    content-benefits.php
    content-blog.php
    content-page.php
    content-pricing.php
    content-webinar.php
    content-webinarArchive.php
    content.php
    Footer
    (footer.php)
    form.php
    Theme Functions
    (functions.php)
    Header
    (header.php)
    Main Index Template
    (index.php)
    Page Template
    (page.php)
    sidebar-blog.php
    sidebar-footer.php
    single-webinar-archives.php
    Single Post
    (single.php)
    About Page Template
    (t-about.php)
    Benefits Page Template
    (t-benefits.php)
    Home Template Page Template
    (t-home.php)
    Plans and Pricing Page Template
    (t-pricing.php)
    Tour Page Template
    (t-tour.php)
    Webinars-Archive Page Template
    (t-web-old.php)
    Webinars Page Template
    (t-webinars.php)
    taxonomy-webinar-categories.php

    Styles

    Stylesheet
    (style.css)
    ie.css

    esmi

    (@esmi)

    That’s your child theme!?

    Thread Starter JCKnoell

    (@jcknoell)

    yes… I didn’t write it. This is part of the reason the former designer was fired. ??

    esmi

    (@esmi)

    I do not envy you trying to sort this one out. It looks as if it’s pretty much a complete custom theme! Looks like there is a sidebar-blog.php in the theme, so try adding <?php get_sidebar( 'blog' );?> to single.php and see if that works.

    Thread Starter JCKnoell

    (@jcknoell)

    hmm… nope, just back to the random gradient images..

    Yeah, It’s been a pain in the… head, to say the least. I appreciate your empathy. ??

    esmi

    (@esmi)

    Can you drop a copy of the single.php and functions.php files into the pastebin and post the pastebin urls here?

    Thread Starter JCKnoell

    (@jcknoell)

    https://pastebin.com/UWLDnw7q
    https://pastebin.com/ZCGE0RUX

    Thank you very much for your help. ?? You seem to always be the best responder on this forum. You deserve some sort of award. ??

    esmi

    (@esmi)

    There’s definitely some dubious stuff going on in this theme. ?? For example, wp_enqueue_script(‘jquery’); in my_admin_init() (functions.php). why is jQuery being enqueued when it’s loaded by default by WP. You might want to comment that line out in case jQuery is being loaded twice in the back end of the site.

    Then there’s whole block of js in clean_meta_boxes() (functions.php) that should have been enqueued rather than just dropped into the function “as is”. Again, that could be causing problems.

    single.php looks pretty straightforward (albeit rather messy). However, it seems to be calling content-archive.php – another custom template file. Can you drop that into the pastebin?

    Thread Starter JCKnoell

    (@jcknoell)

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<div class="webinar-archive-content entry-content">
    		<?php the_content(); ?>
    	</div><!-- .entry-content -->
    	<footer class="entry-meta">
    		<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
    
    	</footer><!-- .entry-meta -->
    </article><!-- #post-<?php the_ID(); ?> -->

    Is all that’s in content-archive.php

    So, comment out those two things listed above?

    esmi

    (@esmi)

    Is all that’s in content-archive.php

    Well, at least that looks OK.

    comment out those two things listed above?

    Try commenting out the first issue I mentioned (the enqueueing of jquery) and then check eveything ion the back &front end of the site to see if anything broke as a result.

    The second issue – all that js in functions.php – is going to be really difficult to pull out. It seems to be related to some sort of special back end functionality (meta boxes for Posts & Pages?) with clean_meta_boxes() being called by clean_show_meta_box() which in turn is called by clean_add_box(). Change any part of these functions and you’ll probably break this special back end functionality.

    How much freedom do you have to play with this theme? Is it on a live site or just a test site?

    Thread Starter JCKnoell

    (@jcknoell)

    It’s more or less live. Haha, it’s a long story. Short version is that beta is on a database which pushes out to the live site. The live site is cached, so I normally have time to make changes on beta before it goes live, but it’s not as reliable as a normal stage development should ideally be.

    Anyway, I’ll make that first change regarding the enqueueing.
    As for the second part, I have no idea what that is. I’ll ask around and see if anyone else knows.

    Thread Starter JCKnoell

    (@jcknoell)

    so am I just commenting out /*wp_enqueue_script(‘jquery’);*/

    or should I do the entire paragraph?

    Thread Starter JCKnoell

    (@jcknoell)

    It seems to be fine after commenting it out. I think it got rid of the grey gradient? Weird..

    No issues anywhere I can see.

Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘Sidebar on single.php’ is closed to new replies.