nhinshaw
Forum Replies Created
-
Forum: Plugins
In reply to: [The Events Calendar] Exlcude Events from Blog pageChris,
I add the following to my functions.php file:function exclude_category($query) { if ( $query->is_home || $query->is_blog ) {$query->set('cat', '-1');} return $query;} add_filter('pre_get_posts', 'exclude_category');
Where ‘-1’ is the category number assigned to your event posts.
Forum: Fixing WordPress
In reply to: Dynamically generate link path to category postsI resolved this issue by utilizing the following code:
<?php foreach((get_the_category()) as $category) { $category->cat_name . ' '; } ?><a href="<?php echo get_category_link(get_cat_id($category->cat_name)); ?>"><?php echo $category->cat_name ?></a>
Forum: Fixing WordPress
In reply to: Dynamically generate link path to category postsThanks alchymyth. Perhaps I am missing something but I am not quite able to get this to work how I want it to. Placing
<?php get_category_link( $category_id ); ?>
does indeed get the parent to show up, but I am still unable to list the child.For example I am able to get the parent “Success Stories” to be added to the link path, but the destination category e.g. “Administrative” does not get added.
Is there something that I am omitting?
Thanks!
Forum: Fixing WordPress
In reply to: Custom sidebar menu structureThe current code being used can be viewed here: https://pastebin.com/U8MKm8X4
I am still unable to figure out how to not show the child elements of a parent, while showing the child elements of an active parent. I am open to other methods of achieving this effect. Any and all suggestions welcomed as I am a bit stymied at this point.
Thanks!
NathanExcellent, that works like a charm. Thanks!!
** EDIT **
Ideally in this process I would also like to omit having the YEAR shown. (thanks!)Thank you!