Avoid duplicate while merging two query post

Before I start, you have a problem with your meta_query. You should not use relation for a single inner meta_query array relation (string) – The logical relationship between each inner meta_query array when there is more than one. Possible values are ‘AND’, ‘OR’. Do not use with a single inner meta_query array. Your first query … Read more

Disable image rename on upload

The renaming to test1.jpg is not due to any cropping / resizing functions WordPress. This is because you already had a file named test.jpg uploaded, and WordPress does not replace files if one exists in the folder that has the same name. If, for some reason you want it to replace files rather than rename … Read more

Multiple duplicate URL’s

You have code like <a href=”https://wordpress.stackexchange.com/questions/282619/89″><img src=”https://www.docreit.com/wp-content/uploads/2015/09/ABTthumnail3.jpg”></a></div> If your href doesn’t start with a / and isn’t a complete URL like https://example.com/, it will be used as a relative URI, and will simply be added after the current URL. Add 89 after https://www.docreit.com/about/12/ and you get https://www.docreit.com/about/12/89. You’ll have to figure out what part of … Read more

How to avoid duplicating same meta_value?

One way would be to keep track of which years you’ve already printed. Using your code: <?php $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘orderby’ => ‘menu_order’, ‘order’ => ASC ); $attachments = get_posts( $args ); echo ‘<table id=”bibliography”>’; if ( $attachments ) { $already_printed_years = array(); foreach ( $attachments … Read more