Forum Replies Created
-
AuthorPosts
-
July 19, 2016 at 7:25 pm in reply to: Trying to assign a different css class to blog post headers – Altitude Pro #189822DonatelloMember
Hi Again...
I found that this is editing both my posts and my pages. I only want it to apply to posts on my blog page. I'm using a static home page, which does not house the blog. Instead, I have my blog on a separate page called "blog".
Can you help?
Please note that I've tried piecing together bits of information from various websites but am finding I'm in over my head. For example, I tried adding code to use "if_front_page()" but was just guessing and got it wrong. If you could provide any direct assistance I would be greatly appreciative.
Thanks again,
DonJuly 19, 2016 at 6:47 pm in reply to: Trying to assign a different css class to blog post headers – Altitude Pro #189821DonatelloMemberExcellent, Victor; that did it.
Thanks so much. You were a huge help.
Don
July 19, 2016 at 3:44 pm in reply to: Trying to assign a different css class to blog post headers – Altitude Pro #189819DonatelloMemberBefore I mark this as 'resolved', can you tell me if there's a way I can do this in my child theme, Altitude Pro, rather than Genesis?
Thanks again,
DonJuly 19, 2016 at 3:42 pm in reply to: Trying to assign a different css class to blog post headers – Altitude Pro #189818DonatelloMemberVictor,
First of all, awesome name.
Second, thanks so much for your speedy and useful help. Here's how you essentially solved the problem for me:
I'm not a php programmer and so I'm sure exactly what I'm doing when it comes to working with wordpress/php files. Your instructions on that page told me that the way php works is that the element is first named, then it's followed by the class you want to apply to it. Specifically, your example was this:
add_filter( 'genesis_attr_entry-content', 'vmf_my_custom_class' );
With this new understanding, I looked through the various php files located in genesis/lib/structure and found what I was looking for in "post.php":
function genesis_entry_header_markup_open() {
printf( '<header %s>', genesis_attr( 'entry-header' ) );There, I saw the css class that I want to change, "entry-header" and saw to the left of it that it was indeed being applied to the header. Now I can change "entry-header" to something else.
In summary, the answer to my question was: "To tell wordpress to use a different class for blog headers, go to post.php and change 'entry-header' to the name of whatever class you want to use."
Thanks again,
Don -
AuthorPosts