Just an update, I deleted PHP closing tags ?> and changed the code for showing 10 posts for a single category. Now RSS works. Thanks.
This is how my functions.php looks now, it might help someone, and if still something wrong please tell me.
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
add_filter('pre_get_posts', 'posts_in_category');
function posts_in_category($query){
if ($query->is_category) {
if (is_category('news')) {
$query->set('posts_per_archive_page', 10);
}
}
}
-
This reply was modified 8 years, 1 month ago by
blu377.
-
This reply was modified 8 years, 1 month ago by
blu377.
-
This reply was modified 8 years, 1 month ago by
blu377.