Change pubDate in rss feed in another format

In the default wordpress rss feed the element <pubDate> is <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate> and gives a result of <pubDate>Tue, 12 May 2020 12:39:03 +0000</pubDate> how can i change this line to give a result of <pubDate>12/05/2020 12:39:03 +0000</pubDate> (d/m/Y) or <pubDate>12-05-2020 12:39:03 +0000</pubDate> (d-m-Y) but to be valid with RFC-822 ? I tried many variations <pubDate><?php echo mysql2date('r', get_the_time('Y-m-d H:i:s')); ?></pubDate> or <pubDate><?php echo get_post_time( 'd/m/Y …
Category: Web

RSS feed for a custom page template

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')) ), …
Category: Web

Remove Default Read More Link in Manual Excerpt RSS Feed

I have a site that displays manual excerpts on the blog post page: https://teralynnchilds.com/blog. I added a custom read more link using the snippet found here: https://wpmayor.com/add-read-link-manual-excerpts/ The RSS feed (https://teralynnchilds.com/feed) includes the manual excerpt, the custom read more link, AND a default read more link of "keep reading TITLE at SITE". I am trying to remove that default read more link from the feed but cannot find the source anywhere. How do I fix it some my feed only …
Category: Web

Custom RSS does not work for categories and tags

We have a custom RSS in our web. It works normally on Main page and post - https://www.kryptonovinky.cz/feed/spotify But in categories and tags it does not work https://www.kryptonovinky.cz/category/podcasty/feed/spotify redirect to https://www.kryptonovinky.cz/category/podcasty/feed Do you have any idea how to solve it? /* This code initializes the custom RSS Feeds for your website*/ add_action('init', 'customRSS'); function customRSS(){ add_feed('spotify', 'customRSSFunc'); } /* This code seeks the template for your RSS feed */ function customRSSFunc(){ get_template_part('rss', 'spotify'); }
Category: Web

How can I remove certain HTML tags from the RSS feed?

One news aggregator wants to have RSS feed without any links into the <description> field. So I try to use this code in functions.php to remove <a href></a> tags, but it doesn’t work. What’s wrong? How can I remove the tags but keep intact all the text? add_filter('the_content', 'my_custom_feed'); function my_custom_feed( $content ){ global $post; if ( ! is_feed() ) return $content; // Remove all shortcodes $content = strip_shortcodes( $post->post_content ); $content = strip_tags( $content ); // Remove all html …
Category: Web

Disable permalinks, but allow RSS feeds

Have a custom post type event that needs an RSS feed (/feed/?post_type=event) but should not generate permalinks (/events/title-of-post). Problem is that the publicly_queryable argument for register_post_type enables both RSS and permalinks. 'public' => false, //private, turns off permalinks and more 'show_ui' => true, //allow edit via wp-admin 'publicly_queryable' => true, //turn on RSS for events, but (whooops!) also turns permalinks back on Is there a simple way to enable the default Wordpress RSS feed for a custom post type without …
Category: Web

register_post_type - rewrite / feeds, what's it for?

The codex page for register_post_type seems to suggest that it should be possible to disable feed generation for custom post types: rewrite (boolean or array) (optional) Triggers the handling of rewrites for this post type. To prevent rewrites, set to false. ... $args array ... 'feeds' => bool Should a feed permalink structure be built for this post type. Defaults to has_archive value. I read that as meaning this: register_post_type('People', array('rewrite' => array('feeds' => false))); would result in my 'People' …
Category: Web

WordPress not showing the latest articles in RSS feed

I use the FD feedburner plugin to redirect all feeds of my self hosted WP site to Feedburner. That has worked fine until December 2013. Since then the redirection doesn't work anymore. The feed validates fine. The same is true if I subscribe the feed through the Thunderbird RSS reader: posts after 12/2013 are not showing. If I export the posts to a blank WordPress installation, Thunderbird shows all posts in the RSS feed. I'm totally stuck here. Why would …
Category: Web

Use a filter for wp_robots to block CPT/feed/

We have a CPT (with base slug templates) that somehow included in every single post's head a link to /templates/post/feed/. I've removed this link to the feed from the head, but want to block robots from the feed also. From this answer, I can adapt code like: add_filter( 'wp_robots', function( $robots ) { if ( is_singular( 'templates' ) ) { $robots['noindex'] = true; $robots['nofollow'] = true; } return $robots; } ); but don't know how to include is_feed() into this …
Category: Web

RSS - This XML file does not appear to have any style information associated with it. The document tree is shown below

i have a problem with my feed on wordpress that shows this message before the feed This XML file does not appear to have any style information associated with it. The document tree is shown below. https://www.rnbjunk.com/feed/ someone can let me know hot to resolve this and get back a result with a plain text feed like this https://www.tpi.it/feed/ Thank you
Category: Web

Dynamically Create Posts Via XML File

I'm new to wordpress/php and I'm trying to create new posts dynamically through a xml file. The xml I'm working with is this one. The file get updated periodically during the day in a FILO fashion (new item are added at the top and the bottom one get push out) and right now we have someone manually creating new posts every few hours by grabbing a few value in each items. So what I'm wondering is if I can automate …
Category: Web

disable /feed/ for custom post type

Our custom post type posts have an extra feed in their source code: www.example/post-type/post/feed/ I want to remove the extra /feed/ from our CPTs, as they generate 404s. From the register_post_type function reference, I've tried adding 'rewrite' => array('feeds' => false), to: register_post_type('templates', array( 'labels' => array( 'name' => __( 'Templates' ), 'singular_name' => __( 'Template' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Template' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Template' …
Category: Web

When are tags counted? Can it be trigered manually?

I'm using a feed aggregator combined with an auto-tagger for tracking words in a stream. I'm using WP-Cumulus to generate a pretty tag cloud based on these. However, I want to keep the tag cloud "fresh", at the moment it's showing "all-time" tag use. I want it to show tag use for, for example, the 100 newest entries. To do this, I think I might do the following: Write a bit of php that deletes all entries except the 100 …
Category: Web

How to fetch common posts from two feeds?

I'm trying to get an RSS feeds that combines author and category. These are the two feeds I have. https://candid.technology/author/yadullah/feed https://candid.technology/in-news/feed As you can guess, I'm trying to fetch posts that match a category (in-news) from a specific author (yadullah). I don't have access to the website's backend so I can't make any changes to any WordPress code whatsoever. Is it even possible to do this and if yes, how do I do it?
Category: Web

How to preserve HTML from posts in RSS feed

I have set up a sample post with a few different HTML tags. This is the markup, copied from the block editor: <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p>This is paragraph 1.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>In a new paragraph, we begin an unordered list:</p> <!-- /wp:paragraph --> <!-- wp:list --> <ul><li>list item 1</li><li>list item 2</li><li>list item 3</li></ul> <!-- /wp:list --> <!-- wp:image {"id":418,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image size-full"><img src="https://domain.tld/wp-content/uploads/2018/11/logo.png" alt="" class="wp-image-418"/><figcaption>organization logo</figcaption></figure> <!-- …
Category: Web

WordPress create custom XML RSS feed template

I am trying to create a custom XML RSS feed. However, my code is not quite working as expected. Here is what I have done: In functions.php I have created the feed called "top": add_action('init', 'customRSS'); function customRSS(){ add_feed('feedname', 'top'); get_template_part('rss', 'top'); } In my child theme I have created file rss-top.php which contains my template file. I am looking for a quite simple template structure like below: <?xml version="1.0" encoding="UTF-8"?> <articles> <article> <title>Overskrift</title> <teaser>Short excerpt</teaser>d <link>http://link-to-post.com/</link> <image>http://placehold.it/100x100</image> <date>19-06-2017 11:21:00</date> …
Category: Web

Custom taxonomy in custom post RSS feed

I'm trying to add a custom taxonomy (Topics) from my custom post-type to the proper post-type RSS feed. ex: ?post_type=custom_post_type I'm pulling the RSS feed from my main site to another site using WP RSS Aggregator's feed to post add-on, but when I pull it, the custom taxonomy (Topics) isn't being populated when the posts are fetched. I'm a rookie with RSS and PHP so any help is appreciated! Thanks!
Category: Web

How to display LinkedIn feed/company updates into WordPress site?

I've been using LinkedIn Company Updates plugin for over 2 years to display linkedin feeds into wordpress site. But it's not working anymore. I've been trying over a week now to find a way to solve this. I read many forum posts, many other people have the same issue but I didn't find any solution and there is no word from this plugin developer either. And apparently, as far I know this is the only wordpress plugin I've found that …
Category: Web

RSS feed URL for post comment shows HTML source code of page

I am facing a weird issue on my site. When I type RSS feed links, global feed and comments work correctly. But, when I go on a specific post, and enter (mysiteurl.com/postname/feed), It just gives me the HTML source of that page, instead of comments feed. I have latest WordPress 5.8. My permalink structure is working correctly. Just the post comment feed is not working. How can it be solved ?
Category: Web

Reply via email (mailto link) in RSS feed at the end of each post

I came across this post https://ethanmarcotte.com/wrote/replyin/ where author says he added Reply via email link at the end of each post in RSS feed so people have this option to respond via email In his feed (XML format) it looks like this <p><a href="mailto:[email protected]?subject=Reply%20to:%20“Bookiversary.”">Reply via email</a></p> I am using Underscores and it has several default feed templates that come with WP install. I checked WP Codex https://codex.wordpress.org/Customizing_Feeds and didn't find anything specific on how to modify templates to add this …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.