Community Forums › Forums › Archived Forums › General Discussion › No Calendar widget on Digital Pro home page
Tagged: widgets
- This topic has 3 replies, 3 voices, and was last updated 5 years, 9 months ago by
Pieczatki-Online.
-
AuthorPosts
-
April 18, 2019 at 10:27 am #490720
Bobcatou
MemberI've added a few widget areas to the front-page.php of the Digital Pro theme.
I'm able to add widgets to these areas, but I found my placeholder "calendar widget" doesn't want to appear. I was told that this is usually because there is something up with the php. I ran this through a checker and nothing was flagged.
I did get this error with the debugger.
Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309
This is line 309
if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) ) { $strip_teaser = true; }
Here is my front-page.php code. I don't get the error on any other page.
<?php /** * Digital Pro. * * This file adds the front page to the Digital Pro Theme. * * @package Digital * @author StudioPress * @license GPL-2.0+ * @link http://my.studiopress.com/themes/digital/ */ add_action( 'genesis_meta', 'digital_front_page_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * * @since 1.0.0 */ function digital_front_page_genesis_meta() { if ( is_active_sidebar( 'front-page-1' ) || is_active_sidebar( 'front-page-2' ) || is_active_sidebar( 'front-page-3' ) ) { // Enqueue scripts. add_action( 'wp_enqueue_scripts', 'digital_enqueue_digital_script' ); function digital_enqueue_digital_script() { wp_register_style( 'digitalIE9', get_stylesheet_directory_uri() . '/style-ie9.css', array(), CHILD_THEME_VERSION ); wp_style_add_data( 'digitalIE9', 'conditional', 'IE 9' ); wp_enqueue_style( 'digitalIE9' ); wp_enqueue_script( 'digital-front-script', get_stylesheet_directory_uri() . '/js/front-page.js', array( 'jquery' ), CHILD_THEME_VERSION, true ); wp_enqueue_style( 'digital-front-styles', get_stylesheet_directory_uri() . '/style-front.css', array(), CHILD_THEME_VERSION ); } // Enqueue scripts for backstretch. // add_action( 'wp_enqueue_scripts', 'digital_front_page_enqueue_scripts' ); function digital_front_page_enqueue_scripts() { $image = get_option( 'digital-front-image', sprintf( '%s/images/front-page-1.jpg', get_stylesheet_directory_uri() ) ); // Load scripts only if custom backstretch image is being used. if ( ! empty( $image ) && is_active_sidebar( 'front-page-1' ) ) { // Enqueue Backstretch scripts. wp_enqueue_script( 'digital-backstretch', get_stylesheet_directory_uri() . '/js/backstretch.js', array( 'jquery' ), '1.0.0', true ); wp_enqueue_script( 'digital-backstretch-set', get_stylesheet_directory_uri() . '/js/backstretch-set.js' , array( 'jquery', 'digital-backstretch' ), '1.0.0', true ); wp_localize_script( 'digital-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', $image ) ) ); } } // Add front-page body class. add_filter( 'body_class', 'digital_body_class' ); // Force full width content layout. add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); // Remove breadcrumbs. remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); // Add widgets on front page. add_action( 'genesis_after_header', 'digital_front_page_widgets' ); $journal = get_option( 'digital_journal_setting', 'true' ); if ( 'true' === $journal ) { // Add opening markup for blog section. add_action( 'genesis_before_loop', 'digital_front_page_blog_open' ); // Add closing markup for blog section. add_action( 'genesis_after_loop', 'digital_front_page_blog_close' ); } else { // Remove the default Genesis loop. remove_action( 'genesis_loop', 'genesis_do_loop' ); // Add front-page-loop body class. add_filter( 'body_class', 'digital_loop_body_class' ); } } } // Add front-page body class. function digital_body_class( $classes ) { $classes[] = 'front-page'; return $classes; } // Add front-page-loop body class. function digital_loop_body_class( $classes ) { $classes[] = 'front-page-loop'; return $classes; } // Add widgets on front page. function digital_front_page_widgets() { if ( get_query_var( 'paged' ) >= 2 ) { return; } echo '<h2 class="screen-reader-text">' . __( 'Main Content', 'digital-pro' ) . '</h2>'; // genesis_widget_area( 'front-page-1', array( // 'before' => '<div id="front-page-1" class="front-page-1"><div class="widget-area fadeup-effect"><div class="wrap">', // 'after' => '</div></div></div>', // ) ); genesis_widget_area( 'front-page-1', array( 'before' => '<div id="front-page-1" class="front-page-1"><div class="widget-area fadeup-effect">', 'after' => '</div></div>', ) ); //* Wraps front page 2 widgets LWM echo '<div class="wrap">'; genesis_widget_area( 'front-page-2-left', array( 'before' => '<div id="front-page-2-left" class="front-page-2 one-half first"><div class="wrap"><div class="flexible-widgets widget-area fadeup-effect">', 'after' => '</div></div></div>', ) ); genesis_widget_area( 'front-page-2-right', array( 'before' => '<div id="front-page-2-right" class="front-page-2 one-half"><div class="wrap"><div class="flexible-widgets widget-area fadeup-effect">', 'after' => '</div></div></div>', ) ); //*Closes wrap and clears columns LWM echo '</div>'; echo '<div class="clearfix"></div>'; echo '<div class="front-page-4 wrap">'; genesis_widget_area( 'front-page-4a', array( 'before' => '<div id="front-page-4a" class="front-page-4a one-fourth first"><div class="widget-area fadeup-effect">', 'after' => '</div></div>', ) ); genesis_widget_area( 'front-page-4b', array( 'before' => '<div id="front-page-4b" class="front-page-4b one-fourth"><div class="widget-area fadeup-effect">', 'after' => '</div></div>', ) ); genesis_widget_area( 'front-page-4c', array( 'before' => '<div id="front-page-4c" class="front-page-4c one-fourth"><div class="widget-area fadeup-effect">', 'after' => '</div></div>', ) ); genesis_widget_area( 'front-page-4d', array( 'before' => '<div id="front-page-4d" class="front-page-4d one-fourth"><div class="widget-area fadeup-effect">', 'after' => '</div></div>', ) ); echo '</div>'; echo '<div class="clearfix"></div>'; genesis_widget_area( 'front-page-5', array( 'before' => '<div id="front-page-5" class="front-page-5"><div class="wrap"><div class="flexible-widgets widget-area fadeup-effect' . digital_widget_area_class( 'front-page-3' ) . '">', 'after' => '</div></div></div>', ) ); genesis_widget_area( 'front-page-3', array( 'before' => '<div id="front-page-3" class="front-page-3"><div class="wrap"><div class="flexible-widgets widget-area fadeup-effect' . digital_widget_area_class( 'front-page-3' ) . '">', 'after' => '</div></div></div>', ) ); } // Add opening markup for blog section. function digital_front_page_blog_open() { $journal_text = get_option( 'digital_journal_text', __( 'Our Journal', 'digital-pro' ) ); if ( 'posts' == get_option( 'show_on_front' ) ) { echo '<div id="journal" class="widget-area fadeup-effect"><div class="wrap">'; if ( ! empty( $journal_text ) ) { echo '<h2 class="widgettitle widget-title center">' . $journal_text . '</h2>'; } } } // Add closing markup for blog section. function digital_front_page_blog_close() { if ( 'posts' == get_option( 'show_on_front' ) ) { echo '</div></div>'; } } // Run the Genesis loop. genesis();
Any help is appreciated..Thanks
https://yellowspringslodging.com/
BryanApril 18, 2019 at 11:14 am #490721Victor Font
ModeratorThe error from wp_includes is a symptom of something else going on, but it is not the root cause of the error. This is saying that the $post object isn't defined by anything in your code before WordPress is trying to use it.
You need to have a trace to see the execution stack leading up to the reported error. Enable WordPress debug and examine the error log.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 18, 2019 at 11:37 am #490722Bobcatou
MemberI did and got the same thing.
[18-Apr-2019 17:35:22 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309 [18-Apr-2019 17:35:22 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309 [18-Apr-2019 17:35:22 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309 [18-Apr-2019 17:35:22 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309 [18-Apr-2019 17:35:30 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309 [18-Apr-2019 17:35:30 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309 [18-Apr-2019 17:35:30 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309 [18-Apr-2019 17:35:30 UTC] PHP Notice: Trying to get property of non-object in /Users/Bobcatou/Documents/non-sslsites/humanracetheatre.localhost/wp-includes/post-template.php on line 309
April 18, 2019 at 11:46 am #490724Pieczatki-Online
Member -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.