-
AuthorPosts
-
May 16, 2016 at 7:29 pm #633215
On the home page I have added a Custom CSS Class of ‘home-business’ to the Blog Posts element under the heading ‘Business’ in the left column.
If the Blog Style is Grid Layout then the class is attached correctly. See image here.
If I change the Blog Style to any of the other Styles e.g. Single Author, small preview… etc, the home-business custom class disappears. It’s currently set as Single Author, small pic and the class is no longer there on the element.
Is this a bug?
- This topic was modified 8 years, 6 months ago by zimbo.
May 17, 2016 at 1:29 pm #633731Hey zimbo,
You can edit your column element that you are adding your element inside and give it a custom CSS class instead :)
Best regards,
YigitMay 17, 2016 at 2:13 pm #633751Hi Yigit,
That does not solve what I’m trying to do. Here’s the issue.
The Blog Posts element under Business in that left column is Single Author, small pic Style. But the Blog Posts element does not give any control of the meta elements, hence I have some CSS:
.home-business .blog-meta, .home-business .post-meta-infos, .home-business .entry-content { display: none; }
That CSS is not working however because the home-business custom class is not added to the Blog Posts element unless the Blog Style is Grid Layout. Surely not adding the custom class is a bug?
(I tried your suggestion of adding a custom class to the overall column and the class is added but I only want to selectively switch the meta off for some of the Blog Posts elements, not all, but using it on the column switches off all the meta in the column).
May 19, 2016 at 3:49 am #634870Hi,
The other blog styles are using the template includes > loop-index.php while the grid layout is using the postslider shortcode, that’s why you see the custom css class attribute. @Yigit’s solution should solve the issue, adding the blog post element in a separate column with a unique custom css class attribute.
Best regards,
IsmaelMay 19, 2016 at 1:03 pm #635136However the code is designed surely it is a bug that you can only attach a Custom CSS Class to the Blog Posts element when the Style is set to Grid Layout?
I’m happy to hack a source PHP file to fix the bug if you can provide a workaround until this gets fixed in the next theme update.
And @Yigit’s solution does not get round the problem. The column in question has 4 Blog Posts elements in it. I want to change only 3 of those to alter what post meta is shown. If I add a Custom CSS Class to the column itself, rather than each of the Blog Posts, then all 4 Blog Posts elements in the column are targeted, which is not what I want.
May 21, 2016 at 3:40 am #636104Hi,
Use the nth-child css selector if there are multiple blog post element in the column. Add the custom css class to the column then try something like for example:
.home-business .template-blog:nth-child(1) { display: none; }
This will remove the first blog post element inside the column. http://www.w3schools.com/cssref/sel_nth-child.asp
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.