WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_the_terms_list doesn't work anymore (10 posts)

  1. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    Hi!
    I noticed a while ago that the awesome code line get_the_terms_list doesn't seem to work anymore for taxonomies. As long as I only have one taxonomy, then it works fine, but when I add more such as:

    echo get_the_term_list( $post->ID, 'language', '<li>Language: ', ', ','</li>' );
    echo get_the_term_list( $post->ID, 'subject', '<li>Subject: ', ', ','</li>' );

    etc,

    Then the front page (or the used page template) crashes and cuts my page in half, leaving out the sidebar and everything.

    This has left me to give up on custom post types and taxonomies all together.

    I have an awesome tutorial on taxonomies and cpt's and this has worked before, but suddenly it does not.

    I've begun to think of certain plugins that I can use instead, but it seems like a dead end. There are two plugins that could fix this, but the first one (by yoast) only works with regular posts, and the second one (also called simple taxonomies like the one by yoast) doesn't work at all.

    Can somebody please help me with this?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    As long as I only have one taxonomy, then it works fine,

    does it work with either of the taxonomies?

    do you use
    <ul> tags around your code?

    'crashes' - is the rest of the content still in the html code in the browser?

    do you have a link to the site with the problem?

  3. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    Hi!
    Hmm... I checked now and I do not have a
    <ul> around the code. I might have had that before, when I come to think of it.

    As of now, I've stopped using taxonomies and cpt's all together, but after you mention the <ul> thing, I'll try it and I'll get back to you.

    Thank you for your reply!

  4. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    The problem remains, even though I have a

  5. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    The problem remains, even though I have a
    <ul> tag around the code. I can show you an image of the problem. The CPT is in swedish, so just ignore that fact. The problem is still the same. I just used the subject and language taxonomies from the post as examples.

    http://greatdanemaniac.com/images/foder%20cpt.PNG

  6. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    is the rest of the page (i.e. the html code of the second 'get_the_terms_list' and the footer) still in the browser, just not on the screen?

    in which case, it could be a css problem.

    check with 'view' 'source' in the browser

    any single use of 'get_the_terms_list' either with 'language' or 'subject' would be ok?

  7. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    I just checked, and no. It just stops after the first taxonomy.
    In this case I have added several taxonomies, but only the first one is displayed.

    if I use only one (and only that one registered as well) it works fine.

    Here's a link:

    http://test.greatdanemaniac.com/foder/

  8. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    I temporarily got it to work, but I'm not satisfied yet. It seems to work with the twentyten theme, but I mainly use a child theme from the theme coraline... I'll take another look at it tomorrow.

  9. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    Looks like it's impossible to fix with the coraline theme. I think I will give up on using taxonomies. This case is resolved.

    Btw. Please remove one of the duplicate posts I made earlier. It contains a broken link. Thank you.

  10. Anna-Maria Eriksson
    Member
    Posted 3 years ago #

    I solved it!

    Just had to change from get_the_term_list to simply the_terms.

    Glad it worked out...

Topic Closed

This topic has been closed to new replies.

About this Topic