WP_Query for portfolio items from same categories

Home Forums Jevelin Theme WP_Query for portfolio items from same categories

Home Forums Jevelin Theme WP_Query for portfolio items from same categories

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • laszlo_oe
    Participant

    Hi,

     

    Can you please help to complete the WP_Query to be able to get a list of portfolio items, which have the same category or categories assigned?

    I have trouble to get it working.

     

    
    <div>
    <div>          $portfolio_items = new WP_Query(array(</div>
    <div>            'post_type' => 'fw-portfolio',</div>
    <div>            'posts_per_page' => 4,</div>
    <div>            'orderby' => 'rand',</div>
    <div>            'post_status' => 'publish',</div>
    <div>            'post__not_in' => array( get_the_ID() )</div>
    <div>          ));</div>
    </div>
    

     

    Thank you.

    Hi @laszlo_oe,

     

    I hope you are well today and thank you for your question.

     

    To achieve it you have to use taxonomy argument of WP_Query as described in the following page.

     

    https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

     

    The portfolio category taxonomy name is fw-portfolio-category

     

    Best regards,
    Shufflehound team

Viewing 2 posts - 1 through 2 (of 2 total)

Popular choice

Professional Developers At Your Fingertips!

If you need services beyond standard support, we've got your back!

Services we offer:

Demo setup
Advanced customization
Layout adjustment
Graphic work / visualizations
Custom coding
Full WordPress development and design

Services

What we can offer

  • Demo setup +

    If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.

  • Layout adjustment +

    We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.

  • Advanced customization +

    More complex styling changes, theme option modifications, and third-party integrations.

  • Custom coding +

    If you need something that's not included in the theme, we can code it for you.

  • Graphic work / visualizations +

    Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.

  • Full WordPress development and design +

    Full website builds, custom theme development, or plugin creation from scratch.

  • About pricing +

    We'll provide a clear quote based on what you need. No hidden fees.

Professional Developers At Your Fingertips!

Custom Work Form