Query to view scheduled or draft post

First, don’t use query_posts(). Note: This function isn’t meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with new instance of the query. http://codex.wordpress.org/Function_Reference/query_posts The … Read more

Scheduling posts via sql

The closest thing I can think of is a plug-in which will periodically take a draft and publish it for you. http://wordpress.org/plugins/drafts-scheduler/ Maybe that will help you. Update: above plugin has some issues so I wrote another one for this purpose. http://www.superblogme.com/auto-post-scheduler/

Include scheduled ( future ) posts in WordPress post navigation ( previous_post_link, next_post_link )

You can do this by using the get_{$adjacent}_post_where filter. Basically all we are doing is replacing the part of the query that says “find published posts” with “find published or future posts”. /** * Amend the ‘WHERE’ clause in the SQL query to find an adjacent post * * @param required string $where The default … Read more

Comments on future posts

You can not enable comments in future posts. Those posts are not public and are not private, so they verify the conditional in line 61 of wp-comments-post.php file; that conditional is (WP 4.1.1): } elseif ( ! $status_obj->public && ! $status_obj->private ) { /** * Fires when a comment is attempted on a post in … Read more

How to export custom post type with ACF to individual file with automation?

Schedule your backup with WP Cron – https://codex.wordpress.org/Function_Reference/wp_schedule_event In the cron event, run your query for posts or CPTs and be sure to add ‘numberposts’ => -1, to return all. When you loop through your posts from the resulting query, push the values to an array $data[]=$some_string_data_for_prop; https://www.advancedcustomfields.com/resources/get_field/ https://developer.wordpress.org/reference/functions/get_post_meta/ https://codex.wordpress.org/Class_Reference/WP_Post And when you’re ready to … Read more

Is there a way to schedule changes to a page?

you can do this with a shortcode like this add_shortcode(“custom_text_se282078”, function ($attr, $content, $tag) { $result = “”; if (date_i18n(“H”) > $attr[“time”]) { $result = $attr[“text_after”]; } else { $result = $attr[“text_before”]; } return $result; }); with that you just have to put that in the page : [custom_text_se282078 time=”10″ text_before=”text before 10 h” text_after=”texte … Read more

Add scheduled page or post in the menu section on back-end

You can add the future pages with the filter nav_menu_items_page Notes: You can do the same with the posts or other cpt by changing the post type in the hook nav_menu_items_{$post_type} This filter is for the View All tab in the pages. Example: function add_scheduled_pages($posts, $args, $post_type) { $query = new WP_Query( array( ‘post_type’ => … Read more

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