Let Contributors Review only (Not Publish) Others Posts

When something is available for other people to read, it is usually called “published”. This all thing sounds like an overly complex way to have posts which can be read by anyone (since the contributor user is basically public info) with a comment section. I suggest you give some more thought about why do you … Read more

Change archive results based on GET request

You have multiple ways to make this work. What you can do for example, target a page and in the theme for this page or better say the template go and read the GET and make the filtering there. Another approach and what I personally do is create a page and then start playing with … Read more

how i show manual data in a post

You can perform cusom SQL queries on the WordPress database using WPDB. For example: $row = $wpdb->get_row(“SELECT * FROM $wpdb->test WHERE id = 123”); You can then access your id, name and description fields like so: echo $row[‘id’]; echo $row[‘name’]; echo $row[‘description’];

Show post published live

You can create a function for your ajax request, and set a timeout so it repeats. You will also need to send the ids of the current news articles being displayed so you can exclude them from your new WP_Query in your PHP UPDATED – This now uses a data attribute to create an array … Read more

Order result from ajax

So you can use the prepend method: <script> $(document).ready(function(){ var ajaxurl = “<?php echo admin_url( ‘admin-ajax.php’ ); ?>”; var dataArray = <?php echo json_encode($current_posts_ids) ?>; function getMyPosts() { data = { action: “update_news”, data: dataArray}; $.post(ajaxurl, data, function(response) { // reset array dataArray = []; // append the new news posts $(‘.latest-news .posts’).prepend(response); // create … Read more

display multiple posts and posts content on a single URL

First you will need to create a custom page template and copy the styling from your page.php file. After that, you will use a loop below to display all posts in one page.### <?php // the query $wpb_all_query = new WP_Query(array(‘post_type’=>’post’, ‘post_status’=>’publish’, ‘posts_per_page’=>-1)); ?> <?php if ( $wpb_all_query->have_posts() ) : ?> <ul> <!– the loop … Read more

Multiple Pages – Seperate blogs

Go to settings in your dashboard and then to “reading” change your homepage to a static page. This page will then load whenever you load the main site url. You can then create the other 7 pages and add whatever content you want to those pages. Make sure if your menu (appearances/menu) isn’t adding them … Read more

How to Display Most View Post in the template file?

The function getPostViews() is retrieving the total number of views for each post while setPostViews() increases the post views counter each time post is viewed. You need to call setPostViews() somewhere in your single.php and then use below code to retrieve posts on basis of posts view count. $args = Array( ‘post_type’ => ‘post’, ‘posts_per_page’ … Read more