• Resolved mateusvitor

    (@mateusvitor)


    Hi. I need to display my post tags, I’ve gone through the customization and changed to show tags on post meta both for archive and single page, but nothing shows in either. I’m using a child of the Koji theme.
    I also tried replicating your ′singular.php′ file into the child theme and adding

    
     // Output the post meta
     koji_the_post_meta( $post->ID, 'single' );
    

    also to no avail.
    I’ve purged cache as well, just in case.

    • This topic was modified 3 years, 4 months ago by mateusvitor.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mateusvitor

    (@mateusvitor)

    They are showing and change according to my customization options, in the related posts section of each post.

    Thread Starter mateusvitor

    (@mateusvitor)

    I think the issue might be that it is a custom post type.
    I found this on the theme’s functions.php.

    
    // Check that the post type should be able to output post meta
     $allowed_post_types = apply_filters( 'koji_allowed_post_types_for_meta_output', array( 'post' ) );
     if ( ! in_array( get_post_type( $post_id ), $allowed_post_types ) ) {
       return;
     }
    
    • This reply was modified 3 years, 4 months ago by mateusvitor.
    Theme Author Anders Norén

    (@anlino)

    Hi @mateusvitor,

    Yeah, you can use the filter in that code snippet to modify which post types that output post meta, by adding this to your child theme or plugin:

    add_filter( 'koji_allowed_post_types_for_meta_output', function( $post_types ) {
    	$post_types[] = 'your_custom_post_type';
    	return $post_types;
    } );

    — Anders

    Thread Starter mateusvitor

    (@mateusvitor)

    Ok I solved it.

    
    function own_add_cpt_to_allowed_post_types_for_meta_output( $arr ) {
      if( !is_array( $arr ))
        $arr = array( $arr );
      array_push( $arr, 'custom_post_type_slug' );
      return $arr;
    }
    add_filter( 'koji_allowed_post_types_for_meta_output', 'own_add_cpt_to_allowed_post_types_for_meta_output', 10, 3 );
    
    Thread Starter mateusvitor

    (@mateusvitor)

    Hi Anders, hadn’t seen your reply yet, but thank you for the quick response!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Meta items do not appear on page’ is closed to new replies.