Community Forums › Forums › Archived Forums › General Discussion › Notice: Trying to get property of non-object in /wp-includes/post-template.php
- This topic has 5 replies, 2 voices, and was last updated 11 years ago by
Brad Dalton.
-
AuthorPosts
-
April 18, 2014 at 3:01 pm #101218
Chris
MemberHi,
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.jpgfront-page.php:
https://www.dropbox.com/s/zd1ewum5qhkkhy3/front-page.phpThanks 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
April 20, 2014 at 7:06 am #101388Brad Dalton
ParticipantApril 21, 2014 at 6:44 pm #101767Chris
MemberThanks Brad. I was actually using your tutorial for creating a widget area with hover effects for portfolio items:
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 #101798Brad Dalton
ParticipantMissing some code Chris so its hard to say. Happy to help
Did you copy the code from the view raw link?
April 22, 2014 at 9:33 am #101870Chris
MemberThanks 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.phpfront-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 #101987Brad Dalton
ParticipantThe front-page code looks wrong and you're also using exactly the same name for both an I.D and Selector class.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.