Custom Taxonomy Template Variables Available?
I found the answer I was looking for as this: $sport_slug = get_query_var(‘term’);
I found the answer I was looking for as this: $sport_slug = get_query_var(‘term’);
You can check for the single page by using is_single() function. https://developer.wordpress.org/reference/functions/is_single/ As for index page, I am not 100% sure but is_home() may be the one. https://codex.wordpress.org/Function_Reference/is_home
I do not understand your question very much, but if it is a category the template file should be named for taxonomy-category-news.php or taxonomy-category_news.php
please refer to the codex: http://codex.wordpress.org/Template_Hierarchy#Author_display however, your problem is caused by a conflict of the .author class output by the body_class() and this existing style in custom.css: .author { float: left; margin-top: -3px; width: 219px; background: #E7ECEF; border-right: 1px solid #D6DFDC; height: 41px; cursor: pointer; } check why this style is added there in … Read more
If you’re working with custom post types and keep getting 404 errors, you often just need to re-save your site’s permalinks under Settings > Permalinks. Try that and let me know if it works.
You can use pre_get_posts to hook in and change the query. The argument passed to pre_get_posts is the query object. It fires for every query, so you need to check some things first. Quick example (not-tested) — change the order on only the video type’s post type archive page. <?php add_action(‘pre_get_posts’, ‘wpse73991_change_order’); function wpse73991_change_order($q) { … Read more
One can do that by copying imagebrowser.php from /wp-content/plugins/nextgen-gallery/view/ to yourthemedirectory/nggallery.php If you want to customise other templates, you can do the same too. Some more information can also be found here.
There’s no such thing as a taxonomy archive. There is a taxonomy term archive, but no taxonomy archive. E.g. this URL makes no sense in the current system: example.com/category/ But this does: example.com/category/uncategorised/
Always flush the rewrite rules when you register a new public post type or taxonomy. Otherwise the internal rewrite rules will not take that into account when an URL is mapped to a query. You can automate that process by hooking into registered_post_type and registered_taxonomy. Below is the updated code, based on feedback from comments … Read more
Read more carefully about register_taxonomy, you will notice that you forgot a rewrite argument, that anables pretty links (rewrites + links generation) for your taxonomy. As for listing taxonomies you can use wp_list_categories or any other alternatives.