Get First Post content and edit it using pre_get_posts (or similar?!)

You can use the loop_start hook which passes the $WP_Query object by reference. namespace StackExchange\WordPress; class editFirstPostContent { public function load() { if( \is_admin() ) { return; } \add_filter( ‘loop_start’, [ $this, ‘loopStart’ ] ); } public function loopStart( \WP_Query $WP_Query) { if( ! $WP_Query->is_main_query() ) { return; } if( ! isset( $WP_Query->posts[0] ) ) … Read more

Order posts by title and custom field value?

My first attempt to help you with solving your problem would be to do something like this : /* Order Posts Alphabetically */ function prefix_modify_query_order( $query ) { if ( is_main_query() ) { $query->set( ‘meta_query’, array( ‘relation’ => ‘AND’, ‘query_highlight’ => array( ‘key’ => ‘wiloke_listgo_toggle_highlight’, ‘value’ => ‘1’, ‘compare’ => ‘=’ ) ) ); $query->set( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)