Combine privileged users array with my current query

Just add this before your code $authors = array( 1, 2, 3 ); // privileged users array $signed_in_user = wp_get_current_user(); // get current user // check if singed in user is in authors array if ( in_array( $signed_in_user->ID, $authors ) ) : And then this after your code <?php else : ?> This message will … Read more

Page displaying 1st post from a range of custom tax?

If I got it well, something like snippet below should would do what you want. I assume there are four items in your ‘gallery-area’ taxonomy and that the class you apply to your div has to vary accordingly (i.e. span_1_of_4 has to become span_2_of_4, etc.). <?php $gt_args = array(‘fields’ => ‘ids’); $terms = get_terms(‘gallery-area’, $gt_args); … Read more

How do I display posts with specific value in a custom field into my loop?

Use the meta_query argument of WP_Query. For example, if your custom field name is “year” and you want to get the post with year=2013: <?php $loop = new WP_Query( array( ‘post_type’ => ‘Sport’, ‘posts_per_page’ => 3, ‘meta_query’ => array( ‘meta_key’ => ‘year_comm’, ‘meta_value’ => ‘2013’, //Assuming you are using numeric value //if not, delete the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)