Is there a way to order children of post?

This should be doable in the get_children() query, try the following: Take a look at the codex entry of get_children(). You will see that get_children() uses the same args as get_posts(). If you than look at get_posts() you will see that you have 2 order arguments to work with: ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, … Read more

Custom wp-query in wordpress rest api

You can create a route for Rest API using the below code. Simply put this code in your function.php file /* Route For api */ add_action( ‘rest_api_init’, function () { register_rest_route(‘wp/v2’, ‘test’, array( ‘methods’ => array(‘GET’, ‘POST’), ‘callback’ => ‘test’, )); } ); And then simply create a callback function test and put your stuff … Read more

Why can’t publish posts with too much text?

If you look into LONGTEXT documentation you’ll see that: The effective maximum length of LONGTEXT columns also depends on the configured maximum packet size in the client/server protocol and available memory. So I would say that 4GB support is only theoretical, in real life your server configuration wouldn’t allow operating on such a big chunk … Read more

Sort by last word in title

I would use a wp_query. Place this in your functions.php: /** * Order posts by the last word in the post_title. * Activated when orderby is ‘wpse_last_word’ */ add_filter(‘posts_orderby’, function($orderby_sql, \WP_Query $q) { $orderbys = $q->get(‘orderby’); if (!$orderbys) { return; } if ($orderby_sql) { $orderby_sql_array = [$orderby_sql]; } else { $orderby_sql_array = []; } if … Read more

tribe_get_start_time displays the current date and time on other post types than tribe_events

There are various ways to solve this. First coming to mind are checking via is_singular() or get_post_type(). Using the latter you could write foreach( $posts as $p ): setup_postdata( $p ); $post_type = get_post_type($p); if ($post_type === Tribe__Events__Main::POSTTYPE) { //or: if ($post_type === ‘tribe_events’) { // Display the date of the event $p_event = tribe_get_start_time … Read more