How to make certain posts not appear on the main page, but instead only a newly created category(in the menu section)

You can exclude posts in the “Reviews” category from the main feed using the pre_get_posts hook and some WP_Query knowledge: add_action( ‘pre_get_posts’, function ( $wp_query ) { if ( ! is_admin() && $wp_query->is_main_query() && $wp_query->is_home() ) { $wp_query->set( ‘category__not_in’, 4 ); } }); Here I’ve assumed the ID of the category is 4, you’ll need … Read more

Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?

Probably you use get_post on edit page with query object. You can simply use $post->post_author on edit page. For example; $editableid = get_query_var(‘id’); $postedit = get_post($editableid); $author_id = $postedit->post_author; //Always return author ID value. <input type=”hidden” name=”post_author” value=”<?php echo $author_id;?>” /> I hope this code piece helps you. EDIT : For email you use the_author_meta … Read more

Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?

You could add a filter to the post publish process in site A. The filter would check for the tag/category, and if found, run a process to create a post in Site B. See https://codex.wordpress.org/Plugin_API/Action_Reference/save_post . Something like: add_action( ‘save_post’, ‘my_site_b_create_post’ ); function my_site_b_create_post($post_id) { // check for category // if category, then save content … Read more

how to fetch posts from Api in chunks or parts?

You’d probably want to wrap what you’ve done up there into a function and do something like. for ( $counter = 0; $counter <= 1906; $counter += 20) { $responseURL = ‘https://api.hubapi.com/content/api/v2/blog-posts?hapikey=’ . $apiKey . ‘&archived=false&limit=20&offset=” . $counter; $response = wp_remote_get($responseURL, $getArgs); process_API_results($response); $restcounter++; if($restcounter == 6) { // works out to 120 posts then … Read more

User Archive page for Custom Post Type – Pagination Issue

have you already tried this way? <section class=”posts-container”> <div class=”container”> <h2 style=”text-transform: uppercase;”>Posts from <?php echo get_the_author_meta( ‘display_name’, $author ); ?></h2> <?php $args = array( ‘post_type’ => array( ‘style’, ‘travel’ ), ‘posts_per_page’ => -1, ‘author’ => $author ); $author_videos = new WP_Query( $args ); if ( $author_videos->have_posts() ) : while ( $author_videos->have_posts() ) : $author_videos->the_post(); … Read more