New answers tagged

1

Try using the_post_thumbnail WP function, inside your <li id="news-single"> markup definition: <li id="news-single"> <a href="<?php echo esc_url( $item->get_permalink() ); ?>" target="_blank" title="<?php printf( __( 'Posted %s', 'my-text-domain' ), $item->get_date('j F Y | g:i a') ); ?>"> ...


0

PHP files in the wp-includes directory should not be accessible from the outside, they should only be included by wordpress code. Therefor an easy fix to this is to use .htaccess rules to block access to *.php files that are under the wp-includes directory


0

It determines which exact resources do you measure. Retrieving feed is essentially a network request. Making network request isn't CPU or memory intensive, but it is relatively very slow. Depending on limitations and configuration of specific hosts it might or might not be a problem. Also feeds are natively cached. However if cache if flushed in use cases ...


0

Yes it's true your code can consume more resources then normal.Because you are working with feed and fetch_feed() consume more. It creates SimplePie object based on RSS or Atom feed from URL. You can do one thing just limiting your post as below: <h2><?php _e( 'Recent news from Some-Other Blog:', 'wpdocs_textdomain' ); ?></h2> <?php // ...


1

1 fetch_feed will get the feed and store it, along with the time it was fetched. 2 Every time the page with the feed is generated the time will be checked. If it is more than twelve hours ago, the feed will be reloaded. Note that this may interfere with caching plugins, who will bypass the normal page generation. Also, if the site is visited very little, ...


2

Sure, you can. First create the feed as per codex: function anotherfeed_init(){ add_feed('anotherfeed'); } add_action('init', 'anotherfeed_init'); Now, change the post count for this particular feed: function anotherfeed_post_count( $query ) { if( $query->is_main_query() && is_feed('anotherfeed') ) $query->set( ...


4

Alright kids, we're gonna leverage a couple of awesome WordPress features today. First things first, let's get that custom feed registered with add_feed: /** * Register "my_feed". */ function wpse_226681_register_feed() { // do_feed_rss() loads the default RSS template in WordPress add_feed( 'my_feed', 'do_feed_rss' ); } add_action( 'init', ...


3

I tested following code and it worked just fine for me: function my_name_shortcode( $atts ) { return "<h3>PRASAD</h3>"; } add_shortcode( 'name', 'my_name_shortcode' ); add_filter( "the_excerpt_rss", "do_shortcode" ); The result can be seen in below screenshot.



Top 50 recent answers are included