Homepage › Community Forums › Aspire Theme Support › All my Widgets Are Lost!! › Reply To: All my Widgets Are Lost!!
Never mind I find out what it is. When you commented the featured image code, you added // for each line.
// Add featured image above the entry content
//add_action( 'genesis_before_entry', 'aspire_featured_photo' );
//function aspire_featured_photo() {
// if ( ! ( is_singular() && has_post_thumbnail() ) ) {
return;
// }
// $image = genesis_get_image( 'format=url&size=single-posts' );
// $thumb_id = get_post_thumbnail_id( get_the_ID() );
// $alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );
// if ( '' == $alt ) {
$alt = the_title_attribute( 'echo=0' );
// }
// printf( '<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', esc_url( $image ), $alt );
//
Instead of trying to figure out exactly which line the error was coming from, I removed all of the // from that block of code, and added /* and */ at the beginning and the very end of the code. Like this –
// Add featured image above the entry content
/*add_action( 'genesis_before_entry', 'aspire_featured_photo' );
function aspire_featured_photo() {
if ( ! ( is_singular() && has_post_thumbnail() ) ) {
return;
}
$image = genesis_get_image( 'format=url&size=single-posts' );
$thumb_id = get_post_thumbnail_id( get_the_ID() );
$alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );
if ( '' == $alt ) {
$alt = the_title_attribute( 'echo=0' );
}
printf( '<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', esc_url( $image ), $alt );
*/
In the future if you ever need to comment out a whole block of code like this, I’d recommend just adding /* and */ at the beginning and end of the code.
Your widgets are available now, so you can go and move them back where they were on your homepage.
You can still use the Customizer to change colors, the only reason your widgets didn’t show up is because of that error above. So you should be good to go. Let me know if there’s still an issue.
