Get parents child pages

Solved it, and decided I could best post my answer here, since people can learn from it 🙂 <?php global $post; $children = get_pages( array( ‘child_of’ => $post->ID ) ); $siblings = get_pages( array( ‘child_of’ => $post->post_parent ) ); // or, if you want to exclude the current page: // $siblings = get_pages( array( ‘child_of’ … Read more

Is it possible to change slugs’ default behaviour?

Test you the following filter work for you: function wpse245094_fist_duplicate_slug( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) { // slug had to change, we must have a duplicate if ( $original_slug !== $slug ) { // try to replace `-2` with `-es` $new_slug = preg_replace( ‘#-2$#’, ‘-es’, $slug ); if ( $new_slug !== $slug ) … Read more

the_content() Not Grabbing All Content

Try calling the_post() at the top of the file before calling functions like the_title() and the_content() If that doesn’t work, then most likely you have a function on the the_content filter that is causing this problem. Try disabling the plugins you have installed one by one to see if that fixes the problem

Group search results by category

Add in the search parameter to your query: $search_filters = array( ‘post_type’ => ‘page’, // Doorzoekt alle post types ‘s’ => $keyword // show only posts that meet the current search query ); And above that you should just be able to grab the keyword right from your querystring like so: $keyword = $_GET[‘s’]; There’s … Read more