Custom post type (Jigoshop): unexpected value for $category_id (via $term->term_taxonomy_id) on live server

For a Category landing page that only shows each ‘product_cat’ image that links to a separate page for each category, I have the following template enclosed. It doesn’t use $term->term_taxonomy_id but rather $term->term_id. Not sure if it will help, but look it over for differences from what you have. <?php /** * Product taxonomy template … Read more

How to controll the Posts post type and general wondering about WP data structure

You can use the globals $menu, $submenu and $wp_post_types for renaming. Code: function wpse124233_alter_builtin_post_menu_label() { global $menu; global $submenu; $menu[5][0] = __( ‘YourName’ ); $submenu[‘edit.php’][5][0] = __( ‘YourName’ ); $submenu[‘edit.php’][10][0] = __( ‘Add YourName’ ); $submenu[‘edit.php’][16][0] = __( ‘YourName Tags’ ); } add_action( ‘admin_menu’, ‘wpse124233_alter_builtin_post_menu_label’ ); function wpse124233_alter_builtin_post_labels() { global $wp_post_types; $labels = &$wp_post_types[‘post’]->labels; $labels->name … Read more

Loop Custom Post Type for Single Author

You should not be using query_posts() to create custom queries, for this, use WP_query() You should get what you want with this code. <?php $args = array( ‘post_type’ => array( ‘post’ ), ‘posts_per_page’ => 10, ‘author’ => $author ); $author_videos = new WP_Query( $args ); if ( $author_videos->have_posts() ) : while ( $author_videos->have_posts() ) : … Read more

Problems making shortcode with custom post types and taxonomy

That is a very broken Loop. The results of a new WP_Query is not a simple array that you can foreach over. It is far more complicated than that. Try var_dump($work_galleries);. Fortunately, WP_Query provides methods to make looping easy. $work_galleries = new WP_Query($args); if ($work_galleries->have_posts()) { while ($work_galleries->have_posts()) { // this replaces foreach $work_galleries->the_post(); // … Read more

Looping through custom taxonomy and display custom post types (Custom Post Type UI)

Try this, this should retrieve all taxonomies terms including empty ones. <?php $terms = get_terms(‘price_types’, array( ‘hide_empty’ => false, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’ ) ); echo print_r($terms); foreach( $terms as $term ): ?> <section class=”pricing”> <h2><?php echo $term->name; ?></h2> </section> <?php endforeach; ?>

Redirect to URL if x number of days passed

To redirect after 3 days gone after publication, hook into template_redirect, check if is a singular cpt view, check the date and compare to current time and redirect if needed. In the 3 days time frame, check if stats is is the query vars and if so redirect to post page. add_action(‘template_redirect’, ‘check_the_date_for_stats’); function check_the_date_for_stats() … Read more

Get terms for a specfic post from multiple taxonomies in custom post type

You kind of not telling what the problem is, like debug, error message you get. There is most likely something wrong with how you wrote that, I’m not willing to go trough this right now. But generally you should make this cleaner and separate parts for an better structure, regarding the taxonomy name as id … Read more