Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customization Question
- This topic has 6 replies, 2 voices, and was last updated 8 years, 5 months ago by pixeldroid.
-
AuthorPosts
-
November 21, 2015 at 9:32 pm #171736pixeldroidMember
I am customizing the LifeStyle Pro theme and I'd like to place a border around the individual Widgets on the homepage and also around each of the posts. The problem is that when the posts are loaded into the widgets, they have the exact same classes as they do on the pages which display the individual posts, so I'm getting 2 borders on the homepage.
Looking at http://thepixelfarm.com/mmob01/, note how the widgets on the home page and the the posts inside those widgets each have an outline. Looking at http://thepixelfarm.com/mmob01/category/breastfeeding/patient-education/, we see that each post has an border. What I want is to have the border on the widgets and the posts, but not on the posts when they are inside the widgets. Is it possible to add a class to the posts which won't be included when the post is loaded into a widget?
Also, I'm not getting the "Read More" text in my home page widgets, but it does show in the individual posts – any idea why?
Thanks.
November 22, 2015 at 12:06 am #171743PorterParticipantDue to the way your .widget and .post share so much common styling, the easiest way is to honestly override the border when on the home page, like so:
.home .post { border: none; }
Add that to style.css, and it's a quick and easy fix. If you're up to it, you can decouple your .widget and .post code a bit (if they don't share every aspect, separate it), and then make some classes specific to the areas needed. That being said, the above works, so don't over-complicate things if you don't feel the need.
November 23, 2015 at 1:25 pm #171850pixeldroidMemberThanks a lot for that. I see that the classes assigned to body can be very useful in customizing the styles in a number of situations. That is great.
When embedded in a widget, a post includes all of its classes, so without modifying the php, I don't think there would be any way to to decouple the widget and post classes.
November 23, 2015 at 1:32 pm #171853PorterParticipantYeah, doesn't look like there's a simple way to decouple that, and really, as long as you're writing specific rules that apply only in certain circumstances, there's no need. Glad it worked out for you!
November 23, 2015 at 1:47 pm #171854pixeldroidMemberLooking at the same page, can you see why I’m not getting the “Read More” text in my home page widgets? It does show in the archive pages (see the posts on http://thepixelfarm.com/mmob01/category/breastfeeding/patient-education/).
November 23, 2015 at 1:58 pm #171858PorterParticipantAre the excerpts being used on the front page widgets created manually, or grabbed automatically?
November 24, 2015 at 5:23 am #171904pixeldroidMemberI tested various Widget/'More Tag' settings and figured it out.
For the record, here's what I learned:Results of Featured Post Widget - 'Content Type'/with 'More' tag in post:
Show Content – Show excerpt and 'Read More' link. Else show whole post.
Show Excerpt – Show excerpt, no 'Read More' link. Else, not sure how it determines excerpt length, no 'Read More' link.
Show Content Limit - Show excerpt and 'Read More' link. Else, obey 'Limit content to # characters' and show 'Read More' link. # Chars is approximate and appears to include the 'Read More' text.
No Content - Only show what is set in widget – e.g. Post Title, Featured Image. -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.