This topic has 4 replies, 3 voices, and was last updated 8 years by Radu.

  • Author
  • #115395
     edgy2016
    Participant

    hi, i’m using this code to obtain the category id but it returns empty:

    $cat_name = get_the_category( get_the_ID );

    $category_id = get_cat_ID( $cat_name );

    echo category_description( $category_id );

     

    PD: this category is a category portfolio

    any help?

    #115572
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #116230
     Radu
    Moderator

    Hi,

    Try like this

    $categories = get_the_terms($post->ID, "portfolio");

    Let me know

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #116259
     edgy2016
    Participant

    it worked perfectly.
    thanks

    #116332
     Radu
    Moderator

    Great

    Have a nice week

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?