0

I would like to know if it is possible to have a custom feed based on a page template and how?

This is my custom query:

$my_custom_query = new WP_Query( array('cat' => array (4335, 12488),
    'posts_type' => 'post',
    'showposts' => 35,
    'paged' => $paged,
    'meta_key' => 'views', 
    'orderby'=> 'meta_value',
    'order' => 'desc',
    //'orderby' => 'desc',
    // BOF EXCLUDES POSTS YOUNGER THEN TODAY -30 DAYS *  
    'date_query' => array(
    'column' => 'post_date',
    //'after' => '2010-01-01',
    //'before' => date('Y-m-d', strtotime('-30 days')) 
    ),
    // EOF EXCLUDES POSTS YOUNGER THEN TODAY -30 DAYS 
    //'offset' => '21',
    'post__not_in' => get_option( 'sticky_posts' ),
    'meta_query' => array('0' => array('key' => 'videos_na', 'value' => 'true', 'compare' => 'NOT EXISTS'),
    array('key' => 'master_id', 'value' => 'true', 'compare' => 'NOT EXISTS'),
    array('key' => 'old_id', 'value' => 'true', 'compare' => 'NOT EXISTS'),
   )));
3
  • 2
    Is this page template a custom WP_Query or get_posts that's re-implementing a post archive so you can put it at another URL or use a page builder? Normal archives can be turned into RSS feeds by adding /feed on the end, their URLs can be changed via their post type/taxonomy registrations, and their contents via pre_get_posts, otherwise WP will assume that you want an RSS feed of the pages comments
    – Tom J Nowell
    Commented May 23, 2022 at 12:31
  • I've updated my question to expose my custom query. Thanks!
    – bpy
    Commented May 23, 2022 at 13:00
  • This was the answer that I needed: [link]wpbeginner.com/wp-tutorials/… Thank you all!
    – bpy
    Commented May 24, 2022 at 12:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.