Administrator Posts

You can possibly try the following: Install ACF plugin and can create a front end page to edit any posts. (I have done this) Next, write a code to make sure that the post is not authored by the administrator. (I didnt try this out yet)

New Post bubble

<?php if( date(‘U’) – get_the_time(‘U’, $post->ID) < 24*60*60 ) : ?> <div class=”bubble”><?php _e(‘NEW’, ‘mytheme_name’); ?></div> <?php endif; ?> the above one will show NEW div for each post posted in 24 hours. You can simply add anywhere in your posts loop. You can use 7 * 24 * 60 * 60 to make it … Read more

how to make special modal for each post

Yes it is possible. I think you are using bootstrap modal. And it is looks like this: Bootstrap Modal <!– Button trigger modal –> <button type=”button” class=”btn btn-primary” data-toggle=”modal” data-target=”#exampleModal”> Launch demo modal </button> <!– Modal –> <div class=”modal fade” id=”exampleModal” tabindex=”-1″ role=”dialog” aria-labelledby=”exampleModalLabel” aria-hidden=”true”> <div class=”modal-dialog” role=”document”> <div class=”modal-content”> <div class=”modal-header”> <h5 class=”modal-title” id=”exampleModalLabel”>Modal … Read more

Get post by two meta key but order by one of them

use ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘post_views’, ‘order’ => ‘DESC’, instead of ‘orderby’ => array( ‘post_views’ => ‘DESC’, ), your way is okay for string, but when you use number it is better to use meta_value_num meta_value will sort number weird 1, 3, 34, 4, 56, 6, etc, rather than 1, 3, 4, 6, 34, … Read more