Forum Replies Created
-
AuthorPosts
-
January 12, 2014 at 2:57 pm in reply to: Possible to make Featured Image display as a background image? #84815
mattspaeth
MemberI just figured it out. It works great! Here it is in case anyone else wants to do it:
// Add Post featured image as a background image above post title, single posts only add_action( 'genesis_after_header', 'custom_before_post_image'); function custom_before_post_image() { if ( is_page() ) return; if ( is_home() ) return; if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) { printf( '<div class="post-featured-image"><div class="post-photo" style="background-image: url(%s);"></div></div>', $image ); } }
January 7, 2014 at 11:19 am in reply to: Force the Genesis Featured Posts widget to show the 'Read More' link? #83839mattspaeth
MemberFound this great post on creating tweaking the Genesis Featured Posts widget by Peter Coughlin:
http://petercoughlin.com/tweaking-the-genesis-featured-posts-widget/Using that, I created a duplicate of featured-posts-widget.php in the theme folder, unregistered the old one and registered the new one.
Now I am trying to tweak the code to display the 'Read More' link when no content is being displayed, but having difficulty getting it to work.
This is the section that I believe needs to be modified:
if ( ! empty( $instance['show_content'] ) ) { echo genesis_html5() ? '<div class="entry-content">' : ''; if ( 'excerpt' == $instance['show_content'] ) { // Show Content the_excerpt(); } elseif ( 'content-limit' == $instance['show_content'] ) { // Show Content Limit the_content_limit( (int) $instance['content_limit'], esc_html( $instance['more_text'] ) ); } else { printf ('Show Excerpt'); global $more; $orig_more = $more; $more = 0; the_content( esc_html( $instance['more_text'] ) ); $more = $orig_more; } echo genesis_html5() ? '</div>' : ''; }
I haven't been able to get any of my modifications to show up. I even commented out this entire section to see if it would break the plugin but it didn't. I was wondering if my theme was actually loading this version of the widget instead of the old one. So then I commented out the entire function that encloses this section, which did break the plugin so I know I have all that taken care of.
This PHP is over my head. I am working through the tutorials at http://www.developphp.com/, but if anyone can offer some advice to help me get this project done, I would really appreciate it!
Thanks,
MattDecember 10, 2013 at 6:21 pm in reply to: Making a 3-col header with logo centered using header-left #78208mattspaeth
MemberBrad, what a great find! That's exactly what I'm looking for. Thank you 🙂
EDIT: Just realized that's your site! Many thanks. Liked on FB.
December 10, 2013 at 12:33 pm in reply to: Any way to display two types of content in the Genesis Responsive Slider? #78094mattspaeth
MemberThanks, that's an interesting slider. But with all those features I am wondering how bloated it is.
Good call on the redirect. But I am thinking the new portfolio entry would show in the loop for the portfolio content type, no?
mattspaeth
MemberThank you Jen, that worked great.
mattspaeth
MemberEdit for clarity: I am looking to pull just the most recent post.
mattspaeth
MemberThanks Jen, I tried both of your suggestions and it's not working. Is there anything that can conflict with these? The only other additions are a remove_action and an add_action which places post-info above the titles on the home page.
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_before_post_title', 'genesis_post_info' ); -
AuthorPosts