WordPress.org

Ready to get started?Download WordPress

Forums

Filter my args by the post 1st letter (1 post)

  1. thedvirs
    Member
    Posted 1 year ago #

    Hi there,
    I filter my WP_Query by this script:

    $args = array (
    					'posts_per_page' => $posts_per_page,
    					'post_type' => $post_type,
    					'meta_key' => 'post_views_count',
    					'orderby' => 'meta_value_num',
    					'showposts' => 160,
    					'order' => 'DESC',
    					'paged' => $paged,
        				'tax_query' => array(
            				array(
                				'taxonomy' => $term->taxonomy,
                				'field' => 'slug',
                				'terms' => $term->name)
        					));

    And I would like to add the filter SUBSTRING(post_title, 1,1) ='z'.
    it possiable to implement it?
    what's the best practices to loop only post which start with X letter?
    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic