Hi John – thanks so much!!
Yes I definitely understand the first part, adding the post_type support for thumbnails, I will unhack your plugin and put that in my functions.php. ??
On the second part, adding the thumbnail to the shortcode, I *think* I understand what you’re saying…..but clearly I’m still missing something.
I’m using the accordion style output (but eventually I’ll modify my functions.php to filter both styles, in case we ever change to toggle).
SO I grabbed this code from class-arconix-faq.php (this is from the accordion_output function):
$return = '';
// Set up our anchor link
$link = 'faq-' . sanitize_html_class( get_the_title() );
$return .= '<div id="faq-' . get_the_id() . '" class="arconix-faq-accordion-title ' . get_the_title() . '">';
$return .= get_the_title() . '</div>';
$return .= '<div id="' . $link . '" class="arconix-faq-accordion-content">' . apply_filters( 'the_content', get_the_content() );
$return .= $this->return_to_top( $link );
$return .= '</div>';
Next, I added the filter wrap and modified the $return variables, like so:
add_filter( 'arconix_faq_accordion_output', 'my_faq_accordion' );
function my_faq_accordion( $return ) {
$return = '';
// Set up our anchor link
$link = 'faq-' . sanitize_html_class( get_the_title() );
$return .= '<div id="faq-' . get_the_id() . '" class="arconix-faq-accordion-title ' . get_the_title() . '">';
$return .= get_the_title() . '</div>';
$return .= '<div id="' . $link . '" class="arconix-faq-accordion-content">';
$return .= '<div class="faq-thumb">';
$return .= the_post_thumbnail('thumbnail') . '</div>';
$return .= apply_filters( 'the_content', get_the_content() ) . '</div>';
if ( $echo === true )
echo $return;
else
return $return;
}
I put that in my functions.php file, but what I got was just the thumbnails first, then below them the normal output…..I need the thumbnails to be contained within the content (answer) DIV, but even though it seems like they should be based on how I modified the output, they are not. I did try changing the function call from my_faq_accordion( $return ) to my_faq_accordion( $echo = false ) but that did not make any difference.
SO obviously I’ve got something wrong, but can’t see it – can you tell what am I doing wrong?