Display FNumber (aperture) as a number versus a fraction

Assuming it is appropriate to do so, you can change your code to this: <dt>EXIF data:</dt> <dd><ul> <?php foreach ($exif as $key => $value): if (($key != “Width”) && ($key != “Height”) && ($key !=”DateTime”)): ?><li><strong><?php if ($key == “model”) { echo “Camera”; } elseif ($key == “ExposureTime”) { echo “Exposure”; //$newvalue = explode(“(“, $value); … Read more

Add more button if more 8 items

$countries is not a number, but w WP_Query instance, so you can’t compare it with a number… This means that you should replace this: if ($countries > 7) { with: if ( $countries->found_posts > 7 ) { It will check if there are more than 8 countries that match your criteria. This way you can … Read more

Print last modified date only on posts

You can check the post type with get_post_type(). You only want to display the content if the value is post: function wpb_last_updated_date( $content ) { $u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); if ( get_post_type() === ‘post’ ) { if ( $u_modified_time >= $u_time + 86400) { $updated_date = get_the_modified_time( ‘F jS, … Read more

Remove a div from RSS feed

You can use the_content_feed hook for that. It is used to filter the content of the post after it is retrieved from the database and filtered by “the_content” and before it is sent to RSS reader (or browser). So here’s the code: add_filter( ‘the_content_feed’, function ( $content ) { $content = str_replace( ‘<div class=”well”> <a … Read more

Remove the first 5 characters of the_title and orderby that

WordPress WP_Query’s orderby parameter has a lot of options but nothing as specific as what you are after. I think you’d have to do this after retrieving posts through the WP_Query, then sort them using usort(). Your code should be something like this. $args = array( ‘post_type’ => ‘z_day’, ‘posts_per_page’ => -1, ‘meta_query’ => array( … Read more