May 29, 2014 at 1:04 pm #107339
I'm using Agency Pro theme and set up some custom fields for a custom post type. It's working fine to the naked eye, but the markup is wrong. No matter what I do, all of the entry content displays inside the entry header div rather after it.
Basic post markup:
— [article class="entry ..."]
— — [header class="entry-header"]...header stuff...[/header]
— — [div class="entry-content"]...content stuff...[/div]
My CPT markup:
— [article class="entry ..."]
— — [header class="entry-header"]
— — — ...header stuff...
— — — [ div class="entry-content"]...content stuff...[/div]
— — [/header]
Sorry I can't post to the page itself but I'm working locally. Here is my code in case anyone wants to take a stab at it. Been at it all day with google and I bet it's some silly little thing I'm missing.May 29, 2014 at 1:25 pm #107350
FYI the HTML debugging is telling me that there is no closing tag for <header class="entry-header">. I'm not messing with any of the theme's html, so I'm guessing there must be some additional code I need to include in the add_action or in my function.May 29, 2014 at 2:13 pm #107356
I'm using a different theme, so this may be offbase, but in mine to appear after the header (and not within it) I would start the code with:
add_action( 'genesis_after_header', 'olotus_offerings_subhead' );
Have you tried that?May 29, 2014 at 2:13 pm #107357
Nothing like posting to forum to finally solve the problem on your own!
So my bad: I had code elsewhere in my functions file to remove the header entry meta for that cpt, and I had also removed the header markup.May 29, 2014 at 2:14 pm #107358
Goodonya. Oh how I wish the problem I posted about the time you did turned out the simple. 🙂
CheersMay 29, 2014 at 2:59 pm #107365
Actually, it was a bit different because I wanted some of the code to go within the header and some of it after (in entry content)... but the closing header tag was missing because I had added this in my functions file (I wanted to get rid of the post info):
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); remove_action( 'genesis_entry_header', 'genesis_post_info' ); remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 15 );
As soon as I got rid of the first and third line, I was good: post info gone, markup still there.May 29, 2014 at 3:40 pm #107368
And this can be changed as well
if ( is_single() && 'offerings' == get_post_type()\
if ( is_singular( 'offerings' ))
This is how i code custom meta boxes and use genesis_get_custom_field http://wpsites.net/wordpress-admin/custom-meta-box-text-area/
Brad Dalton has written 1000 + Genesis tutorials & 4000+ Code Snippets .May 30, 2014 at 7:33 am #107465
Brad, thank-you for the cleaner code tip! Still learning 🙂
Also thanks for the link to your post. This is really great for learning as even though I have been using ACF (which is by all accounts a solid plugin), I always like to know how things are actually built and how they work. May code a few of these boxes by hand following your method for practice 🙂
Are you at all involved with WP Mentor? Do you ever do code reviews? Doesn't hurt to ask, right? 😉
You must be logged in to reply to this topic.