[Resolved] Get a posts category
I just can’t find a solution or proper hint online… How can I find out a post’s category slug?
– Each post has 1 and only 1 category
– I have pags which have the same slug as he category
– I need to get the matching page ID via the page slug, which equals the category slug… crazy, hm?
So the idea would be something like
DUMMY CODE!!! $cat_slug = get_posts_cat_slug($post->ID); $page_slug = $cat_slug; $page_ID = get_page_ID_by_slug($page_slug); custom second loop with $page_ID
Can anyone help me alittle bit, please?
- The topic ‘[Resolved] Get a posts category’ is closed to new replies.