About title on a page

The best way to modify how a theme presents an archive is to create a child theme and then create a specific altered version of the page you want “fixed”. Template files follow a hierarchy with the most specific file available used. In your case, you could create a file called something like category-finanzasya.php (depending … Read more

Page titles for internal classification of landing pages

The easiest way to do this without editing the page.php template in your theme is to add it as a custom field, then use a plugin (or code) to display that custom field in the control panel on your Pages list. The plugin I’d recommend is Admin Columns. It’s free and highly-rated. Once that’s installed, … Read more

Edit the post title from the frontend

Yes, you can change post title and slug from frontend. by using wp_update_post you can change title and slug of post. in below code, it will update post title and slug of post_id. Replace your-post-title-field with your title field in form. slug will generated using that post title. if ( isset( $_POST[‘my_image_upload_nonce’], $_POST[‘post_id’] ) && … Read more

Replace image name on upload to the new post name on front-end form

You can use sanitize_file_name filter to rename file. put this code in active theme’s functions.php, this will rename image filename as postname if only get title request. I have tested this code and it is working fine. Post name : https://prnt.sc/q3thzw Uploaded renamed image : https://prnt.sc/q3tib7 function make_filename_as_post_name($filename) { $info = pathinfo($filename); $ext = empty($info[‘extension’]) … Read more

How to display featured image description and title?

this might work: $post_thumbnail_id = get_post_thumbnail_id($post->ID); $thumbnail_image = get_posts(array(‘p’ => $post_thumbnail_id, ‘post_type’ => ‘attachment’)); if ($thumbnail_image && isset($thumbnail_image[0])) { $img_description = $thumbnail_image[0]->post_content; $img_caption = $thumbnail_image[0]->post_excerpt; $img_alt = get_post_meta($post_thumbnail_id , ‘_wp_attachment_image_alt’, true); $img_title = $thumbnail_image[0]->post_title; }

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