• Resolved gabyvazquez

    (@gabyvazquez)


    Earlier I had found a solution, but realized that it was not working as intended. So my original post it had been suggested to run a Query for a specific category then run the script below. Unfotunatly it also stopped my other posts from displaying.

    So again, the code below is looking for specific posts which have the custom field thumb. I’d like to have the code still pull all the posts with custom field thumb, but would ALSO like it to pick out only ones based on a specific category

    if ( get_post_meta($post->ID, 'thumb', true)) {?>

    is there a way to have it filter the posts during this part of the code to pull specific categories. for example

    if ( get_post_meta($post->ID, 'thumb', true))AND from Catagory id 1 or Category name {?>

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • So assuming you don’t want to use any of the various arguments available as described in the query_posts article. For example:

    query_posts($query_string. '&meta_key=thumb&cat=1');

    then, you will want to use the in_category() conditional tag in your loop.

    Thread Starter gabyvazquez

    (@gabyvazquez)

    micheal

    <?php if ( get_post_meta($post->ID, 'thumb', true) && in_category('5') ) { ?>

    worked perfectly…thanks again for all the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pulling post based on more then one parameter’ is closed to new replies.