Tag Info

Hot answers tagged

2

You can try the following: ! is_admin() && add_filter( 'the_content', function( $content ) { if( in_the_loop() ) // <-- Target the main loop { $prepend = 'HERE IS SOME CUSTOM TEXT'; // <-- Edit your text here $content = $prepend . $content; } return $content; }, 9 ); // <-- Choose some priority < 10 ...


1

This can be done much better with the date_query property of WP_Query class. This will get the posts before the publish date of the current post // WP_Query arguments $args = array ( 'post_type' => 'posts', 'post_status' => 'publish', 'date_query' => array( 'column' => 'post_date', ...


1

I had the exact same issue. The problem is not one that can be fixed without modifying some code that you probably shouldn't (or perhaps writing a filter or a 'drop-in'). The issue is the CAST directive in the SQL statement. It CASTS the entire table before it does anything, with the amount of records you have, its going to take a while. Capture the query, ...


1

Hook your form processing code to an action that runs before the page is rendered and no redirect will be necessary. function wpd_check_submission(){ if( isset( $_POST['start'] ) ) { // do your post insertion here } } add_action( 'init', 'wpd_check_submission' );



Only top voted, non community-wiki answers of a minimum length are eligible