Title on hovering on the featured image

Alternative approach: <li class=”cycle-item slide-<?php echo $i; ?>”> <span class=”featured-title”><?php the_title(); ?></span> <a href=”https://wordpress.stackexchange.com/questions/97055/<?php the_permalink();?>”><?php the_post_thumbnail(‘featured’); ?></a> </li> then hide the span with CSS, show it on hover of the <li> element, position it over the image with CSS. Example: li.cycle-item { position: relative; } li.cycle-item .featured-title { display: none; } li.cycle-item:hover .featured-title { display: … Read more

the_title() is not displaying over the_thumbnail

the_post_thumbnail() and get_the_post_thumbnail() will output the complete HTML for displaying that image. So this <img class=”img-responsive” src=”https://wordpress.stackexchange.com/questions/274181/<?php the_post_thumbnail(); ?>” alt=””> will be rendered to something like this <img class=”img-responsive” src=”https://wordpress.stackexchange.com/questions/274181/<img src=”…” alt=”..” class=”..”>” alt=””> which is not valid HTML and you can’t really tell how browsers will display this. Now you have 2 choices: Use … Read more

post_exists returning 0 if title contain special characters

Looks like WP is using HTML entity encoding on the special characters, you need to parse the title using the html_entity_decode() function like so. $title = html_entity_decode(get_the_title($result->post_id)); if ( 0 === post_exists( $title ) ) { $title=”Document Id: “.$result->post_id .’ (Deleted)’; } I am not sure if the post exists function decodes the characters but … Read more