Okay I sorted out the issue, although not sure why this is the case. In the file td_module.php on line 488 the segment:
global $wp_query;
$current_queried_term = $wp_query->get_queried_object();
if ( $current_queried_term instanceof WP_Term ) {
$current_term = term_exists( $current_queried_term->name, $current_queried_term->taxonomy );
if ($current_term !== 0 && $current_term !== null) {
$selected_category_obj = $current_queried_term;
}
}
// Get and validate the custom taxonomy according to the validated queried term
if (!empty($selected_category_obj)) {
$taxonomy_objects = get_object_taxonomies($this->post, 'objects');
$custom_taxonomy_object = '';
foreach ($taxonomy_objects as $taxonomy_object) {
if ($taxonomy_object->_builtin !== 1 && $taxonomy_object->name === $selected_category_obj->taxonomy) {
$custom_taxonomy_object = $taxonomy_object;
break;
}
}
// Invalid taxonomy
if (empty($custom_taxonomy_object)) {
return $buffy;
}
$selected_category_obj_id = $selected_category_obj->term_id;
$selected_category_obj_name = $selected_category_obj->name;
}
needs to be changed to:
$td_post_theme_settings = td_util::get_post_meta_array($this->post->ID, 'td_post_theme_settings');
if (!empty($td_post_theme_settings['td_primary_cat'])) {
//we have a custom category selected
$selected_category_obj = get_category($td_post_theme_settings['td_primary_cat']);
} else {
//get one auto
$categories = get_the_category($this->post->ID);
if (is_category()) {
foreach ($categories as $category) {
if ($category->term_id == get_query_var('cat')) {
$selected_category_obj = $category;
break;
}
}
}
if (empty($selected_category_obj) and !empty($categories[0])) {
if ($categories[0]->name === TD_FEATURED_CAT and !empty($categories[1])) {
$selected_category_obj = $categories[1];
} else {
$selected_category_obj = $categories[0];
}
}
}
if (!empty($selected_category_obj)) {
$selected_category_obj_id = $selected_category_obj->cat_ID;
$selected_category_obj_name = $selected_category_obj->name;
}
Once this is done it all worked as intended:
https://screenpresso.com/=jq1Kb
Now, this does not sound like the ideal way to do things, but it does work. If you have advice on a better way, I would be very open to hearing your ideas.
Okay, I have checked and it everything is setup as it should be. I have a feeling since this is a custom post type we need to add the “reviews” post type to a class that pulls in the category.
you can see here we have the primary category set:
https://screenpresso.com/=vT35f
and you can see here the standard Category shows as normal, but the custom post type does not.
https://screenpresso.com/=MrQX
I just need to know where to edit to ensure it pulls the category for both the custom post type and the standard posts
You can also see here, I have setup the CPT settings as they should be:
https://screenpresso.com/=OdeIe
Please let me know if you need to see any other settings or what we can do to make this fix.
I have that set already. Have it set so it knows what category to pull from. It still will not display in modules. I have it to pull from standard categories. since the custom post type uses the same cats as the regular posts.
Any ideas? I can show the settings if need be
Hello,
Thanks for the fast reply. The filter in the category section of the newspaper theme. It has “Latest, featured posts, Most Popular, etc etc” it also has by Review Score. What we are looking to do is change this to use our score attribute since we don’t use the built in review system. The issue is we can not locate where this is called in the files.
Any help would be amazing!
fixed the issue!
It seems like it is an issue with WordPress 4.4 and this theme. I am thinking they need to make an update to the category loop. It may be a quick fix
I have seen the same issue. Waiting on a fix
same issue here!
I am seeing the same issue. It seems to be an issue with WordPress 4.4 and the theme!
We use a different review component, and it works well in most cases, the only issue is that for some reason block 15 will not let the information be added. We managed to add it well to the normal page display as seen here:
http://www.cgmagonline.com/category/review-list/game-reviews/
just not sure why the block will not let us add it in
Okay, I sorted out what block to edit, but now I have run into another issue. The block does not seem to be giving the needed information for my code to execute.
it is now:
// Added for rating requirement : Starts Here
//$blu_review_rating_scale = get_post_meta( get_the_ID(), 'blu_review_rating_scale', true );
$blu_review_rating = get_post_meta( get_the_ID(), 'blu_review_rating', true );
// check if the custom field has a value
if( ! empty( $blu_review_rating ) ) {
echo '<div class="rating-box">';
echo '<i class="rating-text-2">Rating</i><p class="postrating-2">'.$blu_review_rating.'</p>';
echo '</div>';
}
// Added for rating requirement : Ends Here
but this seems to be having issue. The command is not getting the needed information for the code to work. Any ideas?
I managed to sort out the issue. I just disabled and reactivated the theme and it seemed to work. No idea why, but hey, as long as it is fixed!
I have that active, as you can see here:
http://www.screencast.com/users/bfrye27/folders/Default/media/cedc4012-a8d9-40b2-a1b5-43019cfec5b1
could you let me know what you mean by “html structure” it will help me identify where the issue is
but all other post types work flawlessly, why is this the only one with issue?
I should clarify i mean: td-post-template-8
thanks again
Thanks for the help! It seems like a simple upgrade
It took me a little while to get everything working, So I thought I would ensure listed the final code incase anyone was running into the same issues.
The final code to ensure it displays everywhere is:
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if((is_category() || is_tag() || is_author()) && empty( $query->query_vars['suppress_filters'])) {
$post_type = get_query_var('post_type');
if($post_type)
$post_type = $post_type;
else
$post_type = array('post','cpt'); // replace cpt to your custom post type
$query->set('post_type',$post_type);
return $query;
}
}
-
This reply was modified 11 years by
bfrye26.
Okay, it seems it now works! I spoke to soon!
Thanks for all the help!
Okay,
still no dice
Maybe I have the code a little wrong.
Here is my theme.js:
jQuery( document ).ready( function ($) {
if ( $( document.body ).hasClass( 'single' ) ) {
$( '.td-post-content a img' ).addClass( 'td-modal-image' ) ;
}
} ) ;
and here is the part from the functions file:
// include theme.js
//
wp_enqueue_script( 'theme-js', get_stylesheet_directory_uri() . '/js/theme.js', array( 'jquery'), NULL, TRUE );
// for debugging, see all hooks
//add_action( 'all', create_function( '', 'var_dump( current_filter() );' ) );
maybe I am missing something
here is the dev site:
http://www.cgmagonline.com/dev/?reviews=nintendo-new-3ds-xl-hardware-review
I am having issues with this also. The theme.js is loading but it does not seem to be working
Have a look here:
http://www.cgmagonline.com/dev/?reviews=housebound-movie-review
for some odd reason it does not want to load.
Any ideas?
Okay, that fixed it!
The custom post type was added by the reviews system we use. It makes a new category named reviews, adds new fields etc. Sadly with so many reviews using it, it would be a rather large task to move everything over and would also break all the permalinks that are present.
Thanks so much for all your help!
Okay, I tried that, did not seem to make any changes
Here is the code: http://screencast.com/t/ubdjqf1nW
and here is what the menu displays like now: http://screencast.com/t/2nkIsLbO
Is it possible there is something wrong with the way I have the code? I feel it should not be this hard.
Let me know your thoughts,
thanks again!
This worked perfectly! You can consider this topic closed!
Okay, That is almost where we need it. It added back the regular menu, but it still seems to have all the other articles listed as well: http://screencast.com/t/FSXjyyrPUuw
So it is much better then the old one: http://content.screencast.com/users/bfrye27/folders/Default/media/deb1df40-cd82-42f9-a61f-e835c1ba9f6b/oddmenu.jpg
Any ideas what is missing? Maybe I am doing something wrong. Here is my code:
http://screencast.com/t/qHYyTBGVTt
