• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Notice: Trying to get property of non-object in /wp-includes/post-template.php

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Notice: Trying to get property of non-object in /wp-includes/post-template.php

This topic is: not resolved

Tagged: debug, minimum, notice

  • This topic has 5 replies, 2 voices, and was last updated 11 years, 11 months ago by Brad Dalton.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 18, 2014 at 3:01 pm #101218
    Chris
    Member

    Hi,

    I am trying to add a grid of portfolio items using the portfolio CPT items to the front page of my site using minimum-pro. I got the post type created no problem and added some portfolio items and registered the widget area to display the grid in my funtions.php file.

    When I add the code to display the widget area/sidebar to my font-page.php template I get a debug notice "trying to get property of non-object". The grid is actually displaying fine and looks pretty good, but I'm just not sure was is causing the notice to be thrown and I want to make sure I'm doing everything correctly.

    Below are the links to my front-page.php template as well as the screenshot of the notice on the home page.

    Image:
    https://www.dropbox.com/s/yn0lwg48hp8aruk/Photo%20Apr%2018%2C%203%2016%2040%20PM.jpg

    front-page.php:
    https://www.dropbox.com/s/zd1ewum5qhkkhy3/front-page.php

    Thanks in advance for the help! I'm really enjoying getting used to working with the Genesis framework.


    Chris Reed | [email protected] | http://www.chrisreedtech.com

    https://www.dropbox.com/s/yn0lwg48hp8aruk/Photo%20Apr%2018%2C%203%2016%2040%20PM.jpg
    April 20, 2014 at 7:06 am #101388
    Brad Dalton
    Participant

    This is how i did it http://wpsites.net/web-design/genesis-custom-post-type-archive-grid-on-front-or-home-page/


    Tutorials for StudioPress Themes.

    April 21, 2014 at 6:44 pm #101767
    Chris
    Member

    Thanks Brad. I was actually using your tutorial for creating a widget area with hover effects for portfolio items:

    http://wpsites.net/web-design/custom-portfolio-template-with-hover-effects-using-genesis-featured-posts-widget/

    I believe the code that is causing the crash is when I apply the markup to the widget area:

    
    //* Add markup for portfolio widgets
    function minimum_featured_portfolio() {
    	
    	genesis_widget_area( 'featured-portfolio', array(
    		'before' => '<div id="featured-portfolio" class="featured-portfolio widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    
    }

    Chris Reed | [email protected] | http://www.chrisreedtech.com

    April 21, 2014 at 10:07 pm #101798
    Brad Dalton
    Participant

    Missing some code Chris so its hard to say. Happy to help

    Did you copy the code from the view raw link?


    Tutorials for StudioPress Themes.

    April 22, 2014 at 9:33 am #101870
    Chris
    Member

    Thanks again for the response.

    I believe I did copy the code correctly--I just added the widget area to my front-page.php template instead of the featured-widgets.php because I only want the featured items to show up on my home page.

    To test last night I did add a couple of other widgets (i.e. text or featured page) to the widget area and they displayed without generating the notice. So it is related to adding the featured post widget to the widget area to display the portfolio items. As soon as I drop in the featured post widget--even if I select no items to display I'll get the notice.

    Thanks again for the help!

    -Chris

    functions.php:
    https://www.dropbox.com/s/eoav3szct33ynb4/functions.php

    front-page.php:
    https://www.dropbox.com/s/zd1ewum5qhkkhy3/front-page.php


    Chris Reed | [email protected] | http://www.chrisreedtech.com

    April 22, 2014 at 8:14 pm #101987
    Brad Dalton
    Participant

    The front-page code looks wrong and you're also using exactly the same name for both an I.D and Selector class.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble