Increase offset while looping

Yup. What you’re looking for is a smart “counter”. In actuality, your issue is this: You’re trying to avoid duplicate posts. Here’s the popular method to do it. In every file that you run a query, you must add this code: global $duplicated_posts; $args = [ ‘post_type’ => ‘post’, ‘post__not_in’ => $duplicated_posts ]; $query = … Read more

post created but no permalink

Don’t insert into the database directly. Use the proper functions so that the posts are properly created before being inserted into the database. In your case the proper function is wp_insert_post(): wp_insert_post( array( ‘post_type’ => ‘books’, ‘post_title’ => ‘harrypotter’, ‘post_status’ => ‘publish’, ‘post_author’ => 1, ) ); The date field doesn’t need to be set … Read more

Replace default og:image tag YOAST

Use the wpseo_opengraph_image_size filter. You can use any WP image size (default ones like medium or ones added by themes and plugins which will be specific to your site) in the first line: // set ‘medium’ to whichever size you need $size=”medium”; // the size is then applied in this filter add_filter(‘wpseo_opengraph_image_size’, create_function(“$size”, ‘return “opengraph”;’));