function yo_pre_get_posts( $query ){
if( $query->get( 'yo_custom_var' ) == 'foobar' )
{
global $wpdb;
$request = 'a';
$offset = 0;
if( isset($_GET['page']) && !empty($_GET['page']) ){
$offset = ($_GET['page']-1) * 100;
}
$my_query = $wpdb->get_results("
SELECT * FROM $wpdb->posts
WHERE post_title LIKE '$request%'
AND post_type = 'artist'
AND post_status = 'publish'
LIMIT 100 OFFSET $offset;
");
return $my_query; }
}
add_action( 'pre_get_posts', 'yo_pre_get_posts', 10 );
$wp_query = new WP_Query( array(
...
'yo_custom_var' => 'foobar',
...
) );
while ($wp_query->have posts()) : $wp_query->the post();
//do stuff
endwhile;
$text = (!$abc) ? "</ul>";
$text = (!$abc) ? '</ul>' : '';
$content = $post->post_content;
if ( !strtolower($content[0]) = $request ) continue;
$query = new WP_Query( $args );
INSERT INTO wc_terms (term_id, name, slug) VALUES
(1, 'example text', 'example-text'),
(2, 'example text text', 'example-text-text'),
(3, 'example text', 'example-text')
ON DUPLICATE KEY UPDATE slug = CONCAT_WS('-', VALUES(slug), VALUES(term_id));
топик бегло посмотрел, вроде что-то похожее, буду пробовать