Change upload URL by mime type

It turns out the value that points to the PDFs’ locations on disk is stored in the wp_postmeta table, under the meta_value field. For example a media item located at site.com/app/uploads/2019/06/whatever.pdf would have a meta_value value of 2019/06/whatever.pdf. To change the location of all PDFs I first found the IDs of all PDFs (from the … Read more

Remove pagination if search returns empty

add this code in your search.php <?php $show_pagination = true; if($wp_query->post_count < 0) { $show_pagination = false; } ?> <?php if($show_pagination){ ?> <!– The pagination component –> <div class=”container”> <div class=”row mt-3″> <?php understrap_pagination(); ?> </div> </div> <?php } ?> So your search.php look like this : <div class=”wrapper” id=”search-wrapper”> <div class=”<?php echo esc_attr( $container … Read more