How to show default theme header when adding a archive layout

Hi there,

I’m running cornerstone on Buddyboss theme and would like to create custom archives, products views, layouts etc but can’t figure out how to incorporate the existing header rather than having to replicate it in cornerstone?

For example : https://humandesign.ai/2023/03/02/unlock-your-true-potential-ai-the-upcoming-ai-chatbot-powered-by-chatgpt-that-brings-human-design-to-life/

This should probably be a feature for Standalone as a setting, but this will output the header when the Archive is about to output the header. You’ll have to make sure the archive doesn’t have any headers attached or it’ll output both, but that’s something we’ll prevent when we set this up on our end. Let me know how it goes.

add_action("cs_header", function() {
  get_header();
});

Thanks Charlie, where should I drop this code?

Hello @kylehill,

You can insert this code in your child theme’s functions.php file. If you are not using a c child theme, you may need to go to the creators of your theme and check out if they have a child theme ready for download.

Best Regards.

Thanks guys,

It seems to have worked but there is a conflict somewhere.

Any idea how to resolve this? Btw, I absolutely love what Cornerstone and Pro are becoming. They truly are the bst tools in WordPress for creating great websites.

Same here: https://humandesign.ai/celebrities/ross-perot/

I understand this might be a conflict with Buddyboss, but I would appreciate greatly your support on the matter.

Hello @kylehill,

It seems that your theme is loading the content area in columns. This is what I am seeing:

Can you please provide us access to the site so we can check your theme settings? You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Attached are login details. Bear in mind its a multisite, cornerstone is used on the mainsite.

Thank you again for wonderful support.

Any luck? Its quite urgent as most of my traffic is going to these pages. It seems to only be an issue with custom layouts, pages seem to be fine.

I’ve noticed someone has reactivated bootstrap via Toolset on my site. I don’t want bootstrap as it messes with other elements on the site. I’m trying to replace bootstrap with custom layouts.

Hello @kylehill,

I have investigated your issue and I found out that your theme is loading a broken HTML.

Be advised that on a page, there should only be 1 head structure:

After the <head>, you can display the <body> tag but then your theme nested another <head> inside the body. Please contact the creators of the theme for further assistance. By the way, we did not activate any theme or plugin on your site. We have logged in and checked your site, theme, and plugin settings only.

Best Regards.

Hi there,

Thanks for this. But i think the page structure is something to do with us calling the header again with the code that you guys gave me above,

add_action("cs_header", function() {  get_header(); });

There is already a header being called by Buddyboss for sure. If the theme was the problem, surely the other pages with that are using cornerstone also wouldn’t work? Do you know what I mean?

Can you please double check.

Hello @kylehill,

I do not see that your in your BuddyBoss Child theme. I am only seeing this:

<?php
/**
 * @package BuddyBoss Child
 * The parent theme functions are located at /buddyboss-theme/inc/theme/functions.php
 * Add your own functions at the bottom of this file.
 */


/****************************** THEME SETUP ******************************/

/**
 * Sets up theme for translation
 *
 * @since BuddyBoss Child 1.0.0
 */
function buddyboss_theme_child_languages()
{
  /**
   * Makes child theme available for translation.
   * Translations can be added into the /languages/ directory.
   */

  // Translate text from the PARENT theme.
  load_theme_textdomain( 'buddyboss-theme', get_stylesheet_directory() . '/languages' );

  // Translate text from the CHILD theme only.
  // Change 'buddyboss-theme' instances in all child theme files to 'buddyboss-theme-child'.
  // load_theme_textdomain( 'buddyboss-theme-child', get_stylesheet_directory() . '/languages' );

}
add_action( 'after_setup_theme', 'buddyboss_theme_child_languages' );

/**
 * Enqueues scripts and styles for child theme front-end.
 *
 * @since Boss Child Theme  1.0.0
 */
function buddyboss_theme_child_scripts_styles()
{
  /**
   * Scripts and Styles loaded by the parent theme can be unloaded if needed
   * using wp_deregister_script or wp_deregister_style.
   *
   * See the WordPress Codex for more information about those functions:
   * http://codex.wordpress.org/Function_Reference/wp_deregister_script
   * http://codex.wordpress.org/Function_Reference/wp_deregister_style
   **/

  // Styles
  wp_enqueue_style( 'buddyboss-child-css', get_stylesheet_directory_uri().'/assets/css/custom.css', '', '1.0.0' );

  // Javascript
  wp_enqueue_script( 'buddyboss-child-js', get_stylesheet_directory_uri().'/assets/js/custom.js', '', '1.0.0' );
}
add_action( 'wp_enqueue_scripts', 'buddyboss_theme_child_scripts_styles', 9999 );


/****************************** CUSTOM FUNCTIONS ******************************/

// Add your own custom functions here



?>

Thanks.

I added this here (in the private note)

This particular theme it looks like it needs the footer as well. Footer looks broken when you do this though, so honestly this theme just needs to use it’s own templates if we’re having this many issues. I’ll look into getting the archives not overwriting the template. So then the blog content just renders in the_content and uses the theme templates.

add_action("cs_footer", function() {  get_footer(); });

amazing, thank you so much for figuring this out. This means alot to me!

1 Like

Hi @kylehill,

You are most welcome.

Hey guys, I;ve just realised that the layout editor doesn’t load.

Is there a way to debug it?

Hey @kylehill,

I suggest that you try the common troubleshooting listed on this documentation and let us know how it goes.

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.