Community Forums › Forums › Archived Forums › Design Tips and Tricks › Site container is empty, where do I need to add the action in order to fix it?
Tagged: site-container add_action
- This topic has 6 replies, 2 voices, and was last updated 6 years, 11 months ago by
mkbeectrl.
-
AuthorPosts
-
March 7, 2018 at 5:32 am #217418
mkbeectrl
MemberDear fellow developers,
I would like to kindly ask for your support in this matter.
I am developing my first theme with the help of Genesis framework, and I am not yet fully accustomed to all tricks inside it.Right now I have the following issue.
My homepage renders out of the .site-container div.In example I am adding header to:
add_action('genesis_after_header', 'wooctrl_landing_header');
Where I should add it in order to render in the right place? I can;t find that info on any Visual Hook style guid I came across while googling.
March 7, 2018 at 6:12 am #217422Victor Font
ModeratorMost people start building their own themes by using the Genesis Sample theme as a base and modifying it to suit their needs. Custom actions and filters generally go into the child theme's functions.php file or a file included in functions.php. Teaching you how to build a child theme from scratch is beyond the scope of help that we can provide you as community volunteers. There are some great courses available that will teach you how to build a Genesis child theme. A good one is https://knowthecode.io.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 7, 2018 at 7:07 am #217424mkbeectrl
Memberdo use Genesis Sample for my them, but somehow I made a mistake and the content renders like this:
<div class=„site-container”></div>
<header></header>
<div class=„site-inner”>content </div>
March 7, 2018 at 9:05 am #217429Victor Font
ModeratorIt's impossible to tell what you did from the information you've provided. I would restore the sample theme with a fresh copy and start over.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 7, 2018 at 3:15 pm #217466mkbeectrl
MemberOh common, there is no such things like impossible 🙂
I have all remove actions in one place, maybe something will occur to you if you take a look.Are you familiar with a hook or function the creates that site-container div? It will be enough for me to find the issue I guess.
Here are the global changes to the theme:
// Remove Skip Links remove_action('genesis_before_header', 'genesis_skip_links', 5); // Dequeue Skip Links Script add_action('wp_enqueue_scripts', 'genesis_wooctrl_dequeue_skip_links'); function genesis_wooctrl_dequeue_skip_links() { wp_dequeue_script('skip-links'); } //remove seo and archive settings remove_theme_support( 'genesis-seo-settings-menu' ); remove_action( 'admin_menu', 'genesis_add_inpost_seo_box' ); remove_action( 'admin_init', 'genesis_add_taxonomy_archive_options' ); // Force full width content layout add_filter('genesis_site_layout', '__genesis_return_full_width_content'); // Remove site header elements remove_action( 'genesis_header', 'genesis_header_markup_open', 5 ); remove_action( 'genesis_header', 'genesis_header_markup_close', 15 ); remove_action( 'genesis_header', 'genesis_do_header' ); // Remove navigation //remove_theme_support( 'genesis-menus' ); // Remove breadcrumbs remove_action('genesis_before_loop', 'genesis_do_breadcrumbs'); // Remove footer widgets remove_action('genesis_before_footer', 'genesis_footer_widget_areas'); // Remove site footer elements remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 ); remove_action( 'genesis_footer', 'genesis_do_footer' ); remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 ); remove_action( 'genesis_after_header', 'genesis_do_nav' ); // Remove page title remove_action('genesis_entry_header', 'genesis_do_post_title'); // Remove site inner wrap add_filter('genesis_structural_wrap-site-inner', '__return_empty_string'); // Remove edit link add_filter('genesis_edit_post_link', '__return_false'); //Contact form 7 add_filter('wpcf7_form_elements', function($content) { $content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content); return $content; }); // Remove Header Right widget area unregister_sidebar( 'header-right' ); // Reposition the secondary navigation menu. remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_footer', 'genesis_do_subnav', 5 ); add_action('wp_print_scripts', 'rrd_remove_cf7_js'); function rrd_remove_cf7_js() { if ( function_exists( 'wpcf7_enqueue_scripts' ) ) { if ( !is_page('kontakt')) { //replace the slug if needed wp_deregister_script('contact-form-7'); } } } add_action('wp_print_styles', 'rrd_remove_cf7_css'); function rrd_remove_cf7_css() { if ( function_exists( 'wpcf7_enqueue_styles' ) ) { wp_deregister_style('contact-form-7'); } } //Remove result count remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
March 7, 2018 at 3:38 pm #217471Victor Font
ModeratorThe site-container is opened in header.php and closed in footer.php in the main Genesis directory. It is created with the genesis_markup function, which means any filters associated with site-container are generated dynamically. They don't exist until run time.
You may want to take a look at this article to understand how Genesis Dynamic filters work: https://victorfont.com/understanding-genesis-dynamic-apply_filters-part-1/
This is about structural wraps, but you can apply its principles to mark up also.
BTW, your site-container is empty because you've removed all of the content.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 7, 2018 at 8:55 am #218732mkbeectrl
MemberI have solved it the following way:Instead of adding my acf content like this:
add_action('genesis_after_header', 'wooctrl_landing_header'); add_action('genesis_entry_header', 'wooctrl_so_simple_header'); add_action('genesis_after_entry', 'wooctrl_przek1_content');
I should do:
add_action('genesis_loop', 'wooctrl_landing_header'); add_action('genesis_loop', 'wooctrl_so_simple_header'); add_action('genesis_loop', 'wooctrl_przek1_content');
I was wrong, it is still not solved
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.