I can do one or the other, but I can't figure out how to do both. Hopefully someone knows of a way to do it without hard-coding either the theme or WP so I don't lost my customizations after each update? Any help would be greatly appreciated. - Brad
Show 1 full post on front page, but show 10 excerpts on archive pages.
(2 posts) (2 voices)-
Posted 6 months ago #
-
Go to Settings --> Reading Settings and put 1 in Blog pages show at most. Then add this to child-theme's
functions.phpfile (put the code anywhere between opening<?phpand closing?>php tags)function posts_on_category_archive($query){ if ($query->is_category) { $query->set('posts_per_page', 10); } return $query; } add_filter('pre_get_posts', 'posts_on_category_archive');Moved to Support. Please post in the correct section next time.
Personal Website prasannasp.net | WordPress Plugins developed by me.
Graphene Child Theme Template | Graphene Theme Tutorials | WordPress tutorials.Posted 6 months ago #
Topic Closed
This topic has been closed to new replies.
