- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
He there…
My PHP skills are not what I would like them to be, so I was wondering If somebody could help me out here.
In the end I need this:
- green[category-name-here]
I want to accomplish this with listing the categories from WordPress.
So i.e. I got Categories: Blue, Green and Lovely Pinkish in WP backend, the source will show:
Blue
- Green
- Lovely Pinkish
What I got is:
cat_name; ?>">
This probably will never work… (due this post ofc) but like I said, PHP… would love to know it better but I don’t atm.
Thanks a bunch in advance.
With Regards,
Paul
this just came to mind….
foreach((get_the_category()) as $category) {
echo '- cat_name . '">' . $category->cat_name .'
' ;
}
?>
Can’t test it out atm, does this look like a feasible solution?
Think I’m messing up all the points and apostrophes in the PHP.
no stupid me, that won’t work at all… need “wp_list_categories” for starters…
What are you trying to do?, get categories under a specific post or get categories of your site?
Hi Sahanlak,
Thanks for your reply.
I have a filtering system (Isotope), it filters stuff in a div, whatever you put in it. The div of section has a certain class. When you want to filter stuff you call the class with a link of sorts.
Example:
Lets say we have a bunch of posts in all kinds of categories. The loop would be something like:
Not Found
To filter stuff I want a list of my categories. Without WordPress hooks that would look something like:
The colors being the categories.
But as you can imagine I would like this to be dynamic, so when a new category is being added in the backend of WP it all will go automatic.
Thanks!
Paul