Taxonomy landing pages

I can see at least 3 ways to do that. Adding a rewrite rule. See http://codex.wordpress.org/Rewrite_API for details: add_rewrite_rule(‘^(country|person|interest)/?’,’index.php?tax=$matches[1]’,’top’); then use the template_redirect filter to load your template when the taxvariable is there: if (get_query_var(‘tax’)) { # load the template here } You’ll also need to add the tax query var to the list of … Read more

How to Reverse Taxonomy Order

You can do this with the pre_get_posts action. pre_get_posts fires after the query variable object is created, but before the actual query is run. So you won’t suffer performance penalties by running multiple unnecessary queries. In your functions.php: add_action(‘pre_get_posts’,’xx_taxnomy_query’); function xx_taxnomy_query($query) { if ($query->is_main_query() && ! is_admin() && $query->is_tax(‘your_taxonomy’)) { $query->set(‘order’, ‘asc’); return; } }

Checking if a Page has an Associated Term?

Hi @NetConstructor: First thing, assuming your logic worked you can use the ternary operator to simplify your example: <li id=”kids-<?php echo is_term(‘Kids’,’age_groups’) ? ‘on’ : ‘off’; ?>”>Kids Programs</li> The issue seems to be that is_term() is used to check if a term exists, not if it is associated with a particular post. I think what … Read more

Custom taxonomy parent from another taxonomy

I was searching for an answer of the same question, and found a question on SE, that contains the answer: https://stackoverflow.com/a/40868654 In WordPress 3.7, released in 2013, a filter was added that allows manipulating the arguments, used to get the list of terms for the parent dropdown. The filter was also applied on the edit … Read more

Advanced custom fields – taxonomy terms images [closed]

OK had a go at this myself, I didn’t realise ACF was able to add fields to taxonomies which is really handy so I wanted to figure it out too. <?php $libargs=array( ‘hide_empty’ => 0, ‘parent’ => 0, ‘taxonomy’ => ‘library_categories’); $libcats=get_categories($libargs); foreach($libcats as $lc){ $termlink = get_term_link( $lc->slug, ‘library_categories’ ); ?> <a class=”single-library-cat” href=”https://wordpress.stackexchange.com/questions/71287/<?php … Read more

custom post type category page

Since you are using a custom taxonomy and not the native post categories you need to name your file taxonomy-{taxonomy}.php and in your case it would be taxonomy-mycategories.php Take a look at the section of the template hierarchy to display custom taxonomy archives.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)