How to style archive post titles… but only those posts who have comments?

Use have_comments() function. Example: <?php if ( have_comments() ) : ?> <h2 class=”has-comments”><a href=”https://wordpress.stackexchange.com/questions/363222/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <?php else : ?> <h2><a href=”https://wordpress.stackexchange.com/questions/363222/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <?php endif; ?>

how to set alt & title for featured image get_the_post_thumbnail

You can use the second parameter of the_post_thumbnail() function. the_post_thumbnail( ‘mudra-featured-image’, [‘alt’ => get_the_title()] ); Another option, you can do this using the filter wp_get_attachment_image_attributes add_filter(‘wp_get_attachment_image_attributes’, function($attr){ $attr[‘alt’] = get_the_title(); return $attr; }); Note, using the filter will affect other images printed using any function that depends on wp_get_attachment_image() So, you may use the other … Read more

Use of comment_reply_link_args filter

You mean, something like this? add_filter( ‘comment_reply_link_args’, ‘change_author_title’, 10, 2 ); function change_author_title( $args, $comment ) { $args[‘reply_to_text’] = ‘Reply to ‘ . get_comment_author( $comment ); return $args; } Explanation: I changed the function declaration so that it accepts the second parameter ($comment) which is the comment object (a WP_Comment instance), then I simply call … Read more

Can’t split the_title() by white space

The first way you tried should work if you use get_the_title() instead. It’s because get_the_title returns the title, whereas the_title() function echos the title by default. $title_split = explode(” “, trim(get_the_title()));

Delete a repeated part of post title in WordPress

if you have access to your database, as every posts are registered in the (wp_/ or whatever is your prefix )posts , you can probably do it via sql something like update wp_posts SET post_title = substring(post_title,1, CHAR_LENGTH(post_title) – 10)) WHERE post_title like ‘%With Table’

Address as a content type post

Welcome to WPSE. This is a rather broad question and perhaps not quite on topic here, but here are some links that should get you started developing a solution to match your needs. Introduction to Plugin Development – A custom plugin is good place for this kind of custom functionality so it won’t be lost … Read more

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