Genesis Framework, Custom Fields and Collapse-O-Matic
-
Hello, I purchased the Collapse-O-Matic pro version a while back and I’ve had an idea of working with it to show/hide content pulled from custom fields without using the short code. However, I’m having a little issue with rolling-my-own. I’m using a hook within the Genesis framework, which pulls and displays the custom field data just fine, and then wraps the content with tags. Unfortunately the content is expanded and will not trigger to work to close or expand either way.
When clicking on the title or arrow I see where the “colomat-close” class is added to the tag with the trigger, but nothing works. It’s probably a simple issue, and once figured out I’ll be laughing at my bone-head mistake, however, any assistance would be greatly appreciated.
Genesis Hook Snippet
add_action( 'genesis_entry_content', 'awards_achievements_content', 11 ); function awards_achievements_content() { if ( is_single() && genesis_get_custom_field('awards_achievements') ) $col_id = 'awards-achievements'; echo '<div class="collapseomatic" id="expand_' . $col_id.' " title="Awards & Achievements">Awards & Achievements</div>'; echo '<div id="target_' . $col_id . '" class="collapseomatic_content">' . genesis_get_custom_field('awards_achievements') . '</div>'; }
Output
<div class="collapseomatic" id="expand_awards-achievements " title="Awards & Achievements">Awards & Achievements</div> <div id="target_awards-achievements" class="collapseomatic_content"> Some content from custom fields...blah blah blah... </div>>
- The topic ‘Genesis Framework, Custom Fields and Collapse-O-Matic’ is closed to new replies.