Community Forums › Forums › Archived Forums › Design Tips and Tricks › Lifestyle-Pro: Title before image on homepage (featured post widget)
Tagged: front page, home page, image, lifestyle Pro, title
- This topic has 10 replies, 2 voices, and was last updated 10 years, 2 months ago by misura.
-
AuthorPosts
-
October 11, 2014 at 9:08 pm #127528misuraMember
Hi all,
Wife would like the title displayed before the image:
On the home page (only, the single post pages are fine). And probably only the first, big one.
Support pointed me here: http://wpsites.net/web-design/display-featured-image-before-or-after-entry-title-on-single-posts-pages/#
But apparently they didn't read very carefully as this solution is for a single page.
I thought I'd be able to use the same code, just remove the "!", but no go.Searching the forums here didn't show much, except maybe:
Wondering if I'm going to have to copy wp-content/themes/genesis/lib/widgets/featured-page-widget.php to lifestype-pro and modify the PHP there (which I can do, just want to make sure that's the "best way").Thanks
http://luciana.misura.org/October 11, 2014 at 10:38 pm #127533Brad DaltonParticipantUnless there's a filter in the featured page widget, yes, you will need to create your own custom featured page widget and modify the code.
Otherwise you could look for another version of the featured page widget. I know there's many versions of the featured post widget you can look at as a guide to see how its done.
Or this plugin may do what you need. https://wordpress.org/plugins/genesis-featured-page-extras/
October 11, 2014 at 11:42 pm #127541misuraMemberbraddalton
I tried copying the
genesis/lib/widgets/featured-post-widget.php
to
lifestyle-pro/lib/widgets/featured-post-widget.php
But editing the lifestyle-pro file did nothing.
I was able to make the change in genesis/lib/widgets/featured-post-widget.php itself, but that is not going to work with an update. (Hell, Lifestyle-pro being a 'child' of genesis makes me wonder if any changes are safe?)
However, it also failed because it changed all of the widgets, not just the first one.I looked at the plug, it doesn't allow you to change the order of the items.
Looks like I can detect the size of the image and use that to move the title or not.
Still not happy about editing the genesis/lib/widgets/featured-post-widget.php file directly...
October 11, 2014 at 11:54 pm #127542Brad DaltonParticipantWorks perfectly for me when i tested it.
But editing the lifestyle-pro file did nothing.
You will need to edit the widget code after adding the code to your child theme as instructed in the tutorial.
If you don't edit the widget code correctly, like you said, it will do nothing.
The featured page widget only applies to pages and not posts and the featured post widget only applies to posts.
October 12, 2014 at 12:15 am #127543misuraMemberYou're right, i didn't follow all of the instructions.
However, I'm confused about how I thought child themes work.
I thought I could customize the code in the child theme and that would override the parent theme. But I guess not.This still seems to have the problem with upgrades.
If Lifestyle-Pro is updated, is my features-post-widget.php safe? how about functions.php?
If Genesis is upgraded, it might not break my code (since I've made a copy in Lifestyle-Pro) but I won't get any new features that get added to Genesis, without having to re-copy the code and make my updates.I guess what I really need to do is make the widget items draggable.
October 12, 2014 at 12:18 am #127544Brad DaltonParticipantOctober 12, 2014 at 8:24 am #127569misuraMemberif ( $instance['image_size'] === "home-large" ) {
$this->show_the_title( $instance );
$this->show_the_image( $image, $instance );
} else {
$this->show_the_image( $image, $instance );
$this->show_the_title( $instance );
}And I moved the code that displays the 'show_title' and 'show_image' to their own functions.
October 12, 2014 at 8:41 am #127571Brad DaltonParticipantI don't think that's going to reposition the title before the featured image.
Are you referring to the featured page or genesis featured posts widget?
October 12, 2014 at 10:40 am #127581misuraMemberIt works so i'm not sure why you think it won't.
featured-post-widget.php
October 12, 2014 at 10:57 am #127582Brad DaltonParticipantOctober 13, 2014 at 11:37 pm #127719misuraMemberSure. The code I wrote works as expected. Where I put it, that makes me a little nervous.
I went to a wordpress meetup today and they said it is possible to make a grandchild theme, so that might be the answer about where to put my code. -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.