WP Aggregator Feed Limit

// Set custom number of posts for category feeds function custom_category_feed_limit($query) { if ($query->is_feed() && $query->is_category()) { $query->set(‘posts_per_rss’, 100); $query->set(‘nopaging’, true); } } add_action(‘pre_get_posts’, ‘custom_category_feed_limit’);Continue reading

Untitled Snippet (copy)

// Include Simple HTML DOM library for scraping (You may need to download and include this library). if (!function_exists(‘file_get_html’)) { function file_get_html($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $output = curl_exec($ch); curl_close($ch); return…Continue reading

MemberPress: Mailchimp Feed Unblocker

function allow_mc_through( $block, $post, $uri ) { if( isset( $_GET[‘allow_mailchimp’] ) ) { $block = false; } return $block; } add_filter( ‘mepr-pre-run-rule-content’, ‘allow_mc_through’, 11, 3 );Continue reading

Disable RSS – Feed

function remove_feeds() { wp_die( __( ‘Feeds Disabled’ ) ); } add_action(‘do_feed’, ‘remove_feeds’, 1); add_action(‘do_feed_rdf’, ‘remove_feeds’, 1); add_action(‘do_feed_rss’, ‘remove_feeds’, 1); add_action(‘do_feed_rss2’, ‘remove_feeds’, 1); add_action(‘do_feed_atom’, ‘remove_feeds’, 1); add_action(‘do_feed_rss2_comments’, ‘remove_feeds’, 1); add_action(‘do_feed_atom_comments’, ‘remove_feeds’, 1); remove_action( ‘wp_head’, ‘feed_links_extra’, 3 ); remove_action( ‘wp_head’, ‘feed_links’, 2…Continue reading

Untitled Snippet

function obtener_sismos_recientes() { // URL de la API $url = ‘https://ultimosismo.igp.gob.pe/ultimo-sismo/ajaxb/2024?_=1694788511856’; // Obtener los datos de la API $respuesta = wp_remote_get($url); if (is_wp_error($respuesta)) { return ‘No se pudieron obtener los datos de los sismos.’; } $cuerpo = wp_remote_retrieve_body($respuesta); $datos =…Continue reading

featured-images-rss-feed

function featuredtoRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '<div>' . get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'featuredtoRSS'); add_filter('the_content_feed', 'featuredtoRSS');Continue reading

MemberPress: MailChimp Feed Unblocker

function mepr_allow_mc_through( $block, $post, $uri ) { if( isset( $_GET[ ‘allow_mailchimp’ ] ) ) { $block = false; } return $block; } add_filter( ‘mepr-pre-run-rule-content’, ‘mepr_allow_mc_through’, 11, 3 );Continue reading