• Hello

    I have a problem with the hueman theme… I would like add name of custom category and display custom tags and customs related post.

    I try to create a custom page wich use this =>

    <?php get_header(); ?>
    
    <?php hu_get_content( 'tmpl/single-memes-tmpl'); ?>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    but his not working, the file call “themes\hueman\tmpl\index-tmpl.php”

    Thank for the support

    My site lacomtedugeek

Viewing 1 replies (of 1 total)
  • Thread Starter Bamwempan

    (@bamwempan1)

    Resolve for relateded post ?? juste add ‘post_type’ => array(‘memes’, ‘post’,’artwork’),

    /*  Related posts
    /* ------------------------------------ */
    if ( ! function_exists( 'hu_related_posts' ) ) {
    
      function hu_related_posts() {
        wp_reset_postdata();
        global $post;
    
        // Define shared post arguments
        $args = array(
          'post_type'           => array('memes', 'post','artwork'),
          'no_found_rows'       => true,
          'update_post_meta_cache'  => false,
          'update_post_term_cache'  => false,
          'ignore_sticky_posts'   => 1,
          'orderby'         => 'rand',
          'post__not_in'        => array($post->ID),
          'posts_per_page'      => 3
        );
        // Related by categories
        if ( hu_get_option('related-posts') == 'categories' ) {
    
          $cats = get_post_meta($post->ID, 'related-cat', true);
    
          if ( !$cats ) {
            $cats = wp_get_post_categories($post->ID, array('fields'=>'ids'));
            $args['category__in'] = $cats;
          } else {
            $args['cat'] = $cats;
          }
        }
        // Related by tags
        if ( hu_get_option('related-posts') == 'tags' ) {
    
          $tags = get_post_meta($post->ID, 'related-tag', true);
    
          if ( !$tags ) {
            $tags = wp_get_post_tags($post->ID, array('fields'=>'ids'));
            $args['tag__in'] = $tags;
          } else {
            $args['tag_slug__in'] = explode(',', $tags);
          }
          if ( !$tags ) { $break = true; }
        }
    
        $query = !isset($break)?new WP_Query($args):new WP_Query;
        return $query;
      }
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Custom post type / Custom post taxonomies’ is closed to new replies.