Get featured image from post on RSS feed

I just found the right solution: function rss_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $output=”<p>” . get_the_post_thumbnail($post->ID) . ‘</p>’; } return $output . $content; } add_filter(‘the_excerpt_rss’, ‘rss_post_thumbnail’, 20, 1); add_filter(‘the_content_feed’, ‘rss_post_thumbnail’, 20, 1);

How to limit wordpress the_excerpt() dynamically

according to the documentation, it is more correct to change the length of the excerpt using add_filter: add_filter( ‘excerpt_length’, function(){ return 10; }); you can make your own function based on this, like this: add_filter( ‘excerpt_length’, ‘new_excerpt’, 10, 1); function new_excerpt( $lenth ){ return $length; }); … apply_filters( ‘excerpt_length’, 150 );

How to get title of images in post content

just change the $post->ID with get_post_thumbnail_id(), and possibly we can delete also the global $post; if( ! ( function_exists( ‘add_alt_image_content’ ) ) ) { function add_alt_image_content( $content ) { if ( is_single() && in_the_loop() && is_main_query() ) { global $post; $image = get_post(get_post_thumbnail_id()); $image_title = $image->post_title; $pattern = ‘~(<img.*? alt=”)(“[^>]*>)~i’; $replace=”$1”.$image_title.’$2′; $content = preg_replace( $pattern, … Read more

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