• Resolved mik9

    (@mik9)


    Hi, after updating to version 2.1 the Category view is broken. Instead of listing of all post in the category, including excerpts, it shows last post with full text and broken formatting.

    When I disable the plugin or revert back to 2.0 all is OK. I am using Extra theme from Elegant Themes.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author MortenPeterAndersen

    (@mortenpeterandersen)

    Hi mik9
    I think I know whats wrong.
    If you could help me testing it I would really appreciate.

    In the file news.php delete the last lines (85 – 94)

    // Show news items in archive
    function simple_news_show_in_archives( $query ) {
    	if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
    		$query->set( 'post_type', array(
    		'post', 'nav_menu_item', 'news'
    		));
    		return $query;
    	}
    }
    add_filter( 'pre_get_posts', 'simple_news_show_in_archives' );
    Thread Starter mik9

    (@mik9)

    Thanks, this works.

    Plugin Author MortenPeterAndersen

    (@mortenpeterandersen)

    cool – I will update the plugin now ….deleting this lines.
    Thank you for your help

    ??
    Morten

    Thread Starter mik9

    (@mik9)

    Hi, after updating to version 2.4 the same problem occurred again. I had to revert back to v2.2.

    Also, there is one strange thing (I realized it only now, but is even with v 2.2) that if I click on most current news item (and the issue is only for this one) and it opens, I have comment section below it (section id=”comment-wrap”) although I do not use WP comments. I use wpDiscuz instead and only for regular posts. Surely, I can hide this section via css, but maybe it is something that should be fixed too.

    Plugin Author MortenPeterAndersen

    (@mortenpeterandersen)

    Hi mik9
    Strange …. maybe there is something wrong with your theme/plugin?
    I have tested on many installations and everything is working fine … this is indeed strange???
    The problems with comments have nothing to do with the plugin.

    ??
    Morten

    Thread Starter mik9

    (@mik9)

    I am using latest Extra theme (which is sibling of Divi, specially for blogs).

    Thread Starter mik9

    (@mik9)

    And as last time, if I remove following part of code, everything works just OK.

    // Show news items in archive
    
    add_filter('pre_get_posts', 'query_post_type');
    function query_post_type($query) {
      if( is_category() ) {
        $post_type = get_query_var('post_type');
        if($post_type)
            $post_type = $post_type;
        else
            $post_type = array('nav_menu_item', 'post', 'news');
        $query->set('post_type',$post_type);
        return $query;
        }
    }
    • This reply was modified 4 years, 5 months ago by mik9.
    Plugin Author MortenPeterAndersen

    (@mortenpeterandersen)

    Do you get a php error messages?

    Thread Starter mik9

    (@mik9)

    No. Only instead of list of articles with excerpt I get one article without heading and with broken formatting.

    After removal of the part of the code, all is OK, proper listing of news, articles, etc. No PHP error messages.

    Plugin Author MortenPeterAndersen

    (@mortenpeterandersen)

    Hi mik9

    It would be awesome if you are willing to try this code:

    add_filter('pre_get_posts', 'simple_news_query_post_type');
    function simple_news_query_post_type($query) {
      if( is_category() ) {
        $post_type = get_query_var('post_type');
        if($post_type)
            $post_type = $post_type;
        else
            $post_type = array('nav_menu_item', 'post', 'news');
        $query->set('post_type',$post_type);
        return $query;
        }
    }

    this replace everything from line 99 to 110

    ??
    Morten

    Thread Starter mik9

    (@mik9)

    Hi Morten,

    I tested it and again, I got crippled category listings, same as before and same as I described already with introduction of version 2.1.

    Is there any specific reason you need to hack category listing? Because if I just simply remove this filter, everything works perfectly OK, even the list of all news in the new format (resembling news columns).

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Category view broken after update to version 2.1’ is closed to new replies.