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

CWP – MailChimp RSS email ID

/** * RSS feed, add MailChimp email query string */ function cwp_rss_mailchimp_email( $url ) { return add_query_arg( ‘adt_ei’, ‘*|EMAIL|*’, $url ); } add_filter( ‘the_permalink_rss’, ‘cwp_rss_mailchimp_email’ );Continue reading

CWP – ConvertKit RSS email ID

/** * RSS feed, add ConvertKit email query string (Part 1) */ function cwp_rss_convertkit_email( $url ) { return add_query_arg( ‘adt_ei’, ‘subscriber.email_address’, $url ); } add_filter( ‘the_permalink_rss’, ‘cwp_rss_convertkit_email’ ); /** * Modify ConvertKit email string (Part 2) * esc_url will remove…Continue reading

Disable RSS Feeds

/** * Display a custom message instead of the RSS Feeds. * * @return void */ function wpcode_snippet_disable_feed() { wp_die( sprintf( // Translators: Placeholders for the homepage link. esc_html__( ‘No feed available, please visit our %1$shomepage%2$s!’ ), ‘ ‘, ‘‘…Continue reading

Delay Posts in RSS Feeds

function wpcode_snippet_publish_later_on_feed( $where ) { global $wpdb; if ( is_feed() ) { // Timestamp in WP-format. $now = gmdate( ‘Y-m-d H:i:s’ ); // Number of unit to wait $wait = ’10’; // integer. // Choose time unit. $unit = ‘MINUTE’;…Continue reading