Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3157892
RSS Feed not working for category
Closed

Comments

  • getfootball started the conversation

    Hi,

    We are having an issue with the RSS feed as it only shows one post when we choose to see specific categories

    e.g

    teh main feed

    https://www.getfootballnewsfrance.com/feed/atom/  shows 10 articles as per the settings

    When we go to the category page, we see may articles as expected

    https://www.getfootballnewsfrance.com/cup-competitions/world-cup-2022/

    However when we go to the feed page we only see the top article

    https://www.getfootballnewsfrance.com/cup-competitions/world-cup-2022/feed/atom/

    We see this for every category and also on 5 other sites on which we have the Soledad theme

    Are you able to advise please

  •  2,610
    PenciDesign replied

    Hi,

    For this case, please send me your WordPress admin account in a PRIVATE reply.
    I'll log in and try to help you.

    Regards,
    PenciDesign.



  •   getfootball replied privately
  •  2,610
    PenciDesign replied

    Hi,

    Please add the following code to the Soledad child theme "functions.php" file or via the Code Snippet plugin here:

    add_filter('post_limits',function (){
            if (isset ($query->query_vars['feed']) ) {
                return false;
            }
        });

    Regards,
    PenciDesign.



  •   getfootball replied privately
  •  2,610
    PenciDesign replied

    Hi,

    1. I don't make to change anything on your site,

    2. The code I've sent only applies to the RSS Feed only, it doesn't affect the normal query.

    Regards,
    PenciDesign.

  • getfootball replied

    Hi,

    On point 2, I want to limit the feed to 10 posts (which is what is in teh settings)  else we will have hundreds of posts on the feed is not efficient?

    After adding the change in functions.php, I can see that more articles are shown but the limit is not adhered to.

    https://staging2.getfootball.eu/feed/atom/ - shows 13 articles even though limit is 10

    I would like the default feed and category/tag feeds to behave the same if that makes sense.

    Thank you so much for your help

  •  2,610
    PenciDesign replied

    Hi,

    Please modify the code I've sent to get the correct RSS items on the settings:

    add_filter('post_limits',function (){
        if (isset ($query->query_vars['feed']) ) {
            return get_option('posts_per_rss');
        }
    });

    Regards,
    PenciDesign.



  • getfootball replied

    I added this to the functions.php but it continues to return all the posts in the feed.

    Is this issue a result of the theme?

  •  2,610
    PenciDesign replied

    Hi,

    Please modify the PHP code like this:

    add_filter('post_limits',function (){
        if (isset ($query->query_vars['feed']) ) {
            $rss_number = get_option('posts_per_rss', 10);
            return 'LIMIT 0, '.$rss_number;
        }
    });

    Regards,
    PenciDesign.



  • getfootball replied

    Hi,

    Thanks for the message but unfortunately the code still does not work. We get the same issue with all the articles returned.

    Also, the query is disrupting all queries returning all articles for example on the homepage?

    https://staging2.getfootball.eu/

    Kind Regards

  •  2,610
    PenciDesign replied

    Hi,

    I've fixed this issue, this is a small issue from our archive template.

    Please check.

    Regards,
    PenciDesign.


  • getfootball replied

    Hi,

    This appears to be working now as expected. I changed the posts_per_rss setting and it works. Also, the category feeds are working too.

    What is the fix please so I can apply it all our sites that use the Soledad theme.

    Kind Regards

  •  2,610
    PenciDesign replied

    Hi,

    Please copy this file from the staging site to the production site:

    wp-content/themes/soledad/inc/template-builder/helper.php

    Regards,
    PenciDesign.


  • getfootball replied

    Thankyou, This works well now