PHP code to call image Caption, Alternative Text, and Decription?

WordPress stores image (attachment) data as follows: Description: post_content field Caption: post_excerpt field Alt: _wp_attachment_image_alt meta value And in code, that translates to: // Description echo $post->post_content; // Raw the_content(); // Caption (description as fallback) the_excerpt(); // Caption (explicitly) echo $post->post_excerpt; // Raw if ( has_excerpt() ) { the_excerpt(); } // Alt echo get_post_meta( $post->ID, … Read more

Image with description side by side

Yes, I think this is a great, fundamental question of WordPress editing and content creation by low-level users who are met with the big blank editing area and don’t know how to wrangle html. There are myriad answers: hardcore coding, softcore coding, plugins and everything in-between. The answer for me is Advanced Custom Fields. I … Read more

How come my first blog post and my home page have the same title?

The “Reading Settings” at a domain’s wp-admin/options-reading.php is, by default, set to latest posts. So, WordPress, by default, would show the title of the post being set at “General Settings” at a domain’s wp-admin/options-general.php . In this case, Yoast’s WordPress SEO plugin would have form fields to customize it. When the “Reading Settings” are changed … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)