Tagged: x
-
AuthorPosts
-
February 2, 2017 at 2:17 pm #1355649
stevec114ParticipantI am racking my brain to figure out how to alter the output of a category listing page. I’ve opened every file I can think of any can’t find it.
Ideally I would like to show a category archive list of posts that are scheduled for the future but only for one specific category and not others.
I know how to accomplish this with PHP code but not sure what file to use in a child theme.
Please help, thanks!
February 2, 2017 at 2:18 pm #1355650
stevec114ParticipantThis reply has been marked as private.February 2, 2017 at 9:11 pm #1356189
Rue NelModeratorHello There,
Thanks for writing in and for the very detailed information. If you want to alter the output of the Events category page, you can simply change the query if the category is Events. Please check out several ways to do it by checking out this page: http://presscustomizr.com/snippet/three-techniques-to-alter-the-query-in-wordpress/
As this is all custom development, regretfully we won’t be able to assist further. Custom development is outside the scope of our support. We’re happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation.
Thank you for your understanding.
February 2, 2017 at 9:17 pm #1356194
stevec114ParticipantThanks for the response.
I understand that you would not support the work but my original question was which file in the child theme needs to be edited.
February 3, 2017 at 1:05 am #1356385
Rue NelModeratorHello There,
Thanks for updating in! As stated on this page; http://presscustomizr.com/snippet/three-techniques-to-alter-the-query-in-wordpress/, you can simply add those function codes in your child theme’s functions.php file. For example;
// Display future posts // ============================================================================= function display_future_post($query) { if ( $query->is_category('Events') ) { $query->set('post_status', 'future'); } return $query; } add_filter('pre_get_posts', 'display_future_post'); // =============================================================================Hope this explains it.
February 3, 2017 at 8:10 am #1356741
stevec114ParticipantAhh, thanks for your help.
February 3, 2017 at 9:12 am #1356810
RahulModeratorYou’re most welcome! 🙂
Let us know if we can help with anything else.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1355649 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
