jakethebear
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Return all category id's from single postget_the_category() worked perfectly, thank you. For some reason I couldn’t get wp_get_post_categories() to work, no matter how I tried implementing it.
If anyone else is looking to do the same thing and use a specific post’s category ID’s as classes, here’s my code:
<?php $categories = get_the_category(); $separator = ' '; $classes = ''; if($categories){ foreach($categories as $category) { $classes .= 'cat-'.$category->term_id.$separator; } } ?> <div class="<?php echo trim($classes, $separator); ?>"> DIV CONTENT </div>Hi, thanks for your reply but definitely not using any cache plugins. In fact the only plugin I have running is Booking Calendar. I just tried this on a brand new WP install and the same thing is happening. Very confused!
Forum: Fixing WordPress
In reply to: How-to: A simple Client Portal@tzeldin88 just wanted to say thanks sooo much for this! used this method to build a client portal for a recent site and it does EXACTLY what it says on the tin… couldn’t have been a more perfect solution. Will be using this exact technique again and again for sure. Kudos!