• Resolved blmate

    (@blmate)


    Hey there,I was trying to SEO my website, and whilst doing so I had to enable breadcrumbs in the yoast’s plugin, I also used the “external links” plugin.

    After doing so I noticed my right sidebar (with widgets) and plugins were not displaying on my blog posts however they were displaying on my homepage / categories pages.

    I was messing around a bit with the single.php and the page.php templates however I made sure to remove any changes I made and I’m certain I didn’t mess them up.

    If anyone could please have a look at some code and see if I have made any errors or so to result in this.

    The plugins that are no longer working are the Facebook likes / comments plugins. The like button is still displaying on the homepage however no longer on the boxes.

    Also something else that is interesting is the admin bar at the top is no longer displaying when I click on my posts it is only visible when im on my homepage.

    I have tested the website out on different browsers / devices, So I know it is not just my computer/browser with the problem, and also I have tried deactivating through each of my plugins and then refreshing/flushcaching however none of them seem to be the root of the problem.

    Single.php:

    <?php
    /**
    * The Template for displaying all single posts.
    *
    * @package Generate
    */

    get_header(); ?>

    <div id=”primary” <?php generate_content_class();?>>
    <main id=”main” <?php generate_main_class(); ?> itemtype=”https://schema.org/Blog&#8221; itemscope=”itemscope” itemprop=”mainContentOfPage” role=”main”>
    <?php do_action(‘generate_before_main_content’); ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, ‘single’ ); ?>

    <?php
    // If comments are open or we have at least one comment, load up the comment template
    if ( comments_open() || ‘0’ != get_comments_number() ) : ?>
    <div class=”comments-area”>
    <?php comments_template(); ?>
    </div>
    <?php endif; ?>

    <?php endwhile; // end of the loop. ?>
    <?php do_action(‘generate_after_main_content’); ?>
    </main><!– #main –>
    </div><!– #primary –>

    <?php

    Page.php:

    <?php
    /**
    * The template for displaying all pages.
    *
    * This is the template that displays all pages by default.
    * Please note that this is the WordPress construct of pages
    * and that other ‘pages’ on your WordPress site will use a
    * different template.
    *
    * @package Generate
    */

    get_header(); ?>

    <div id=”primary” <?php generate_content_class();?>>
    <main id=”main” <?php generate_main_class(); ?> itemprop=”mainContentOfPage” role=”main”>
    <?php do_action(‘generate_before_main_content’); ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>

    <?php
    // If comments are open or we have at least one comment, load up the comment template
    if ( comments_open() || ‘0’ != get_comments_number() ) : ?>
    <div class=”comments-area”>
    <?php comments_template(); ?>
    </div>
    <?php endif; ?>

    <?php endwhile; // end of the loop. ?>
    <?php do_action(‘generate_after_main_content’); ?>
    </main><!– #main –>
    </div><!– #primary –>

    <?php

    Header.php

    <?php
    /**
    * The Header for our theme.
    *
    * Displays all of the <head> section and everything up till <main id=”main”>
    *
    * @package Generate
    */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge” />
    <title><?php wp_title(”); ?></title>
    <link rel=”profile” href=”https://gmpg.org/xfn/11″&gt;
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>”>
    <?php
    wp_head();
    $generate_settings = wp_parse_args(
    get_option( ‘generate_settings’, array() ),
    generate_get_defaults()
    );
    ?>
    </head>
    <meta name=”sitelock-site-verification” content=”4474″ />
    <body itemtype=”https://schema.org/WebPage&#8221; itemscope=”itemscope” <?php body_class(); ?>>
    <?php do_action( ‘generate_before_header’ ); ?>
    <header itemtype=”https://schema.org/WPHeader&#8221; itemscope=”itemscope” id=”masthead” role=”banner” <?php generate_header_class(); ?>>
    <div <?php generate_inside_header_class(); ?>>
    <?php do_action( ‘generate_before_header_content’); ?>

    <?php if ( is_active_sidebar(‘header’) ) : ?>
    <div class=”header-widget”>
    <?php dynamic_sidebar( ‘header’ ); ?>
    </div>
    <?php endif; // end sidebar widget area ?>

    <?php if ( empty( $generate_settings[‘hide_title’] ) || empty( $generate_settings[‘hide_tagline’] ) ) : ?>
    <div class=”site-branding”>
    <?php if ( empty( $generate_settings[‘hide_title’] ) ) : ?>
    <p class=”main-title” itemprop=”headline”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></p>
    <?php endif;

    if ( empty( $generate_settings[‘hide_tagline’] ) ) : ?>
    <p class=”site-description”><?php bloginfo( ‘description’ ); ?></p>
    <?php endif; ?>
    </div>
    <?php endif;

    if ( !empty( $generate_settings[‘logo’] ) ) : ?>
    <div class=”site-logo”>
    ” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><img class=”header-image” src=”<?php echo $generate_settings[‘logo’]; ?>” alt=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” />
    </div>
    <?php endif; ?>
    <?php do_action( ‘generate_after_header_content’); ?>
    </div><!– .inside-header –>
    </header><!– #masthead –>
    <?php do_action( ‘generate_after_header’ ); ?>

    <div id=”page” class=”hfeed site grid-container container grid-parent”>
    <div id=”content” class=”site-content”>
    <?php do_action(‘generate_inside_container’); ?>

    <?php if ( function_exists(‘yoast_breadcrumb’) ) {
    yoast_breadcrumb(‘<p id=”breadcrumbs”>’,'</p>’);
    } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter blmate

    (@blmate)

    Incase it may come in handy I’am posting the sidebar.php here aswell.

    Sidebar.php:

    <?php
    /**
    * The Sidebar containing the main widget areas.
    *
    * @package Generate
    */
    $generate_settings = wp_parse_args(
    get_option( ‘generate_settings’, array() ),
    generate_get_defaults()
    );

    $navigation_active = false;

    // If the navigation is set in the sidebar, set variable to true
    if ( ‘nav-right-sidebar’ == $generate_settings[‘nav_position_setting’] )
    $navigation_active = true;

    // If the secondary navigation is set in the sidebar, set variable to true
    if ( function_exists( ‘generate_secondary_nav_get_defaults’ ) ) :
    $secondary_nav = wp_parse_args(
    get_option( ‘generate_secondary_nav_settings’, array() ),
    generate_secondary_nav_get_defaults()
    );
    if ( ‘secondary-nav-right-sidebar’ == $secondary_nav[‘secondary_nav_position_setting’] )
    $navigation_active = true;
    endif;
    ?>
    <div id=”right-sidebar” itemtype=”https://schema.org/WPSideBar&#8221; itemscope=”itemscope” role=”complementary” <?php generate_right_sidebar_class(); ?>>
    <div class=”inside-right-sidebar”>
    <?php do_action( ‘generate_before_right_sidebar_content’ ); ?>
    <?php if ( ! dynamic_sidebar( ‘sidebar-1’ ) ) : ?>
    <?php if ( false == $navigation_active ) : ?>
    <aside id=”search” class=”widget widget_search”>
    <?php get_search_form(); ?>
    </aside>

    <aside id=”archives” class=”widget”>
    <h3 class=”widget-title”><?php _e( ‘Archives’, ‘generate’ ); ?></h3>

      <?php wp_get_archives( array( ‘type’ => ‘monthly’ ) ); ?>

    </aside>

    <aside id=”meta” class=”widget”>
    <h3 class=”widget-title”><?php _e( ‘Meta’, ‘generate’ ); ?></h3>

      <?php wp_register(); ?>

    • <?php wp_loginout(); ?>
    • <?php wp_meta(); ?>

    </aside>
    <?php endif; ?>
    <?php endif; // end sidebar widget area ?>
    <?php do_action( ‘generate_after_right_sidebar_content’ ); ?>
    </div><!– .inside-right-sidebar –>
    </div><!– #secondary –>

    Thread Starter blmate

    (@blmate)

    Solved, Added some code in too generate sidebars / footer in single.php

    Thanking myself, seen as I got no help here :/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sidebar Widgets / Plugins not displaying on posts’ is closed to new replies.