[Resolved] Trying to Add Custom Meta to Blog and Archive Listings

Home Forums Support [Resolved] Trying to Add Custom Meta to Blog and Archive Listings

Home Forums Support Trying to Add Custom Meta to Blog and Archive Listings

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #423687
    Samuel

    I’m running into a problem adding a custom entry-meta content. Here’s the situation:

    I only want to list my own custom taxonomy rather than WordPress categories.

    I added code to output the list of terms associated with a post and registered the generate_after_entry_content hook.

    Here’s my two problems:

    On the blog page it doesn’t seem to be running that hook at all (I don’t know if this is normal and I should be using another hook instead?). The result is that I see the categories listed at the end of the entry-summary but I don’t see my custom taxonomy terms listed for the post. However, on archive pages it is running the hook.

    My second problem is that I only want to display my custom taxonomy not the WordPress categories. If I uncheck the box to show WordPress categories then I get nothing on the blog page listing. On the archive page listing, I lose the categories (which I want) but I also lose my custom taxonomy that’s being input via the hook.

    What’s the best way to solve this?

    #423736
    Tom
    Lead Developer
    Lead Developer

    Can you try using the generate_after_content hook instead?

    #423971
    Samuel

    Thank you, I found the problem. When I disable post categories it turns out GP just hides the html using css rather than not generating category information. Because I had an entry-meta class on my custom taxonomy it was getting hidden by the display: none. I’m not sure how I missed that.

    #424236
    Tom
    Lead Developer
    Lead Developer

    Ah yes – it removes the elements, but can’t remove the empty container so it just hides it.

    You can give it a second class like custom and then do this:

    .entry-meta.custom {
        display: block;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.