Why in this archive page that call query_posts() function show only the last 10 posts?

WordPress by default will only load 10 posts. That can be changed in the admin under Settings->Reading and then setting the amount beside “Blog pages show at most”. You can override that number in your custom queries a couple of ways but I would first recommend against the use of query_posts() ( take a read … Read more

post_parent in custom post type

Hook in when a post is deleted, check for the post type, then manipulate post_parent of potential child posts (or delete the posts): function wp_dev_174635_update_posts( $parent_id ) { $parent = get_post( $parent_id ); if ( $parent->post_type !== ‘type2’ ) { return; } $posts = get_posts( array( ‘post_type’ => ‘type1’, ‘post_parent’ => $parent_id, ) ); foreach … Read more

ECHO Executing 4 Times In Head

Filters should return, not echo. function my_content( $content ) { // Something something $content=”my content”; return $content; } add_filter( ‘the_content’, ‘my_content’ ); You can echo, but you’ll need output buffering, like this: function my_content( $content ) { // Something something ob_start(); echo ‘my content’; $content = ob_get_contents(); ob_end_clean(); return $content; } add_filter( ‘the_content’, ‘my_content’ ); … Read more