List child terms and posts in the current term

ok, i don’t know how this looks but i’ve got exactly what i wanted. <?php $term = get_queried_object(); $tax = ‘ntp_package_type’; $parents = $term->parent; $term_id = $term->term_id; if($parents == 0 && !is_single()){ wp_list_categories( array ( ‘taxonomy’ => ‘ntp_package_type’, ‘pad_counts’=> 0, ‘title_li’ => ”, ‘child_of’ => $term_id, ) ); } elseif ($parents > 0 && is_tax($tax, … Read more

Best Way To Structure 3 Tiered Site

You are going to need a place to park all that static content, so that’s more or less got to be a post of some kind with a bunch of custom fields. Whether it’s superficially called a post, custom post type or page might not matter much after you’ve done all the hacking you’re going … Read more

Display categories and their IDs

Are you looking for a list of the current post’s categories and parents, or just a general list of categories? If the former, you can use get_category_parents(). If you’re in The Loop, for example: <?php if( have_posts() ) : while( have_posts() ) : the_post(); // Post stuff // … $cats = wp_get_post_categories( $post->ID ); foreach( … Read more

A simple script/plugin to display specific page upon hierarchy of selections

Well, you already have the two particular category IDs, so list the sub-categories. Like so: $cat_list_1 = wp_list_categories(array( ‘echo’ => 1, ‘child_of’ => FIRST_CAT_ID_HERE, ‘title_li’ => ‘A Name for This’, ‘depth’ => 2, // or whatever you like )); $cat_list_2 = wp_list_categories(array( ‘echo’ => 1, ‘child_of’ => SECOND_CAT_ID_HERE, ‘title_li’ => ‘Another Name for This’, ‘depth’ … Read more

Custom taxonomy archive not showing posts of certain child taxonomies

What you are calling “filter” is just a HTML select element. You need the put the select element in a form and filter the posts based on the selected option of this select element. For example, for the frontend: The form: <form method=”post” action=”<?php echo get_post_type_archive_link(‘rlt_rule’);?>”> <?php $filter_taxonomy = ‘rlt_rule_headline’; wp_dropdown_categories( array( ‘show_option_all’ => ‘Show … Read more

Getting grandchildren of a post with a specified custom taxonomy?

I was able to achieve this by, funnily enough, using with get_pages() and WP_Query(). I wanted a reusable function that would return a WP_Query array that I could loop through, so I came up with this: function returnChildGeographies($geoID, $geoType, $grandChildren = false) { $args = array( ‘post_type’ => ‘geographies’, ‘posts_per_page’ => -1, ‘orderby’ => ‘post_title’, … Read more

Hierarchy between post types

Yes, that is how the hierarchical setting works. Post types are independent entities. You can’t mix and match them just like you can make a “Post” the child of a “Page” or the other way around. So… Is there a way to accomplish this or is this a WordPress limitation? This is intentional behavior. I … Read more

Cross post type parent page added parent page to permalink but give 404

I think that you need only to change the way get_permalink create url for the cpt, ignoring the parent. You can do it adding a filter to ‘post_type_link’ hook and then regenerate the permalink for the product cpt in the same way is done in core, just ignoring the parent: add_filter(‘post_type_link’, ‘reset_light_link’, 999, 3); function … Read more

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