Hello,
Yep, I’ve seen that one though not sure if it’s related, I haven’t touched the ‘title’. The settings are currently basic:
* Title
* Editor
* Featured Image
* Excerpt
* Custom Fields
* Comments
* Jetpack Publicize Support
Nothing in “Advanced Supports”.
Built-In Taxonomies
* Categories (wp built-in)
* Genre (pod)
* Tags (wp built-in)
* Products (pod)
I already had “title” activated when I first created the custom posttype via Pods.
Oh, just remembered, I’m not sure if this is affecting it or something.
// BGN: Show Custom Post Types
add_action( 'pre_get_posts', 'show_cpt_global' );
function show_cpt_global( $query ) {
$post_types = array( 'post', 'pressrelease' );
if ( !is_admin() && !is_feed() ) {
if( !is_post_type_archive() && $query->is_archive() ) {
$query->set( 'post_type', array( 'post', 'pressrelease' ) );
return $query;
}
/*
// is_category() || is_tag()
//if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
if( is_category() || is_tag() ) {
$query->set( 'post_type', array( 'post', 'nav_item_menu', 'pressrelease' ) );
return $query;
}
//if( is_archive() && !is_post_type_archive() && empty( $query->query_vars['suppress_filters'] ) ) {
if( is_archive() && !is_post_type_archive() ) {
$query->set( 'post_type', array( 'post', 'pressrelease' ) );
return $query;
}
//if( is_front_page() && is_home() && empty( $query->query_vars['suppress_filters'] ) ) {
if( $query->is_main_query() ) {
$query->set( 'post_type', $post_types );
return $query;
}
*/
}
}
// END: Show Custom Post Types
// BGN: Fallback Featured Images by Category
function fallback_get_post_metadata( $spare , $object_id , $meta_key , $single ) {
// only interested if this is a call for a thumbnail id in the public interface
if ( is_admin() || $meta_key != '_thumbnail_id' ) return;
// check for an existing thumbnail - note cannot use any function that will set up infinite loop!
$meta_cache = wp_cache_get( $object_id , 'post_meta' );
if ( !$meta_cache ) {
$meta_cache = update_meta_cache( 'post' , array( $object_id ) );
$meta_cache = $meta_cache[$object_id];
}
// if post has a thumbnail then return null to contine
if ( isset( $meta_cache[$meta_key] ) ) return $meta_cache[$meta_key];
// now we need to get the id for the category
// get the categories assigned to the post
$post_cats = get_the_category( $object_id );
// no categories, unlikely but can't do anything
if ( count( $post_cats ) == 0 ) return null;
// we'll just take the first
$term_id = $post_cats[0]->term_id;
// using function from plugin, get the id of the category image
$attach_id = WPCustomCategoryImage::get_attachment_id( $term_id );
// no category image, out of here
if ( !$attach_id ) return null;
// now store this in the post's metadata using id _thumbnail_id
return $attach_id;
}
add_filter( 'get_post_metadata' , 'fallback_get_post_metadata' , 10 , 4 );
// END: Fallback Featured Images by Category
I get confused as to why the first post displays fine in the widget but the next ones not. And it’s only affecting the said widget, the posts itself displays the titles, and the URLs are correct too.
Thank you.