Custom Blog Image Sizes

// Custom Image Sizes function abc($size_arr) { $size_arr = array( ‘related’ => __( ‘Related’, ‘uabb’ ), ‘blogpage’ => __( ‘Blog Page’, ‘uabb’ ), ); // Add your own size to this array. return $size_arr; } add_filter( ‘uabb_blog_posts_featured_image_sizes’, ‘abc’ ); add_filter(…Continue reading

Show featured image in post list

// Show featured image in post list /* * * Add Featured Image Column to Admin Area and Quick Edit menu * Source: https://rudrastyh.com/wordpress/quick-edit-featured-image.html * */ /* * This action hook allows to add a new empty column */ add_filter(‘manage_resource_posts_columns’,…Continue reading

Add image to rss feed

function rss_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = ‘ ‘ . get_the_post_thumbnail($post->ID) . ‘ ‘ . get_the_content(); } return $content; } add_filter(‘the_excerpt_rss’, ‘rss_post_thumbnail’); add_filter(‘the_content_feed’, ‘rss_post_thumbnail’);Continue reading

Floating Social Media Icons (copy)

// Define social media links $facebook_link = ‘https://facebook.com/fb’; $twitter_link = ‘https://youtube.com/@yt’; $instagram_link = ‘https://instagram.com/ig’; echo ‘ .floating-social-icons { position: fixed; top: 50%; left: 0; transform: translateY(-50%); z-index: 1000; } .floating-social-icons a { display: block; margin: 5px 0; width: 40px; height:…Continue reading

Remove users from WP-JSON

add_filter(‘rest_endpoints’, function( $endpoints ) { if ( isset( $endpoints[‘/wp/v2/users’] ) ) { unset( $endpoints[‘/wp/v2/users’] ); } if ( isset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ) ) { unset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ); } return $endpoints; });Continue reading

“New” Badge for Recent Posts (copy)

add_filter( ‘the_title’, function ( $title, $id ) { if ( ! is_admin() && is_single( $id ) ) { $number_of_days = 7; $post_date = get_the_date( ‘U’, $id ); $current_date = current_time( ‘timestamp’ ); $date_diff = $current_date – $post_date; if ( $date_diff…Continue reading

WP Simple Pay: Add Email Address to Payment Confirmation URL

add_action( ‘template_redirect’, function() { if ( ! function_exists( ‘\SimplePay\Core\Payments\Payment_Confirmation\get_confirmation_data’ ) ) { return; } $data = \SimplePay\Core\Payments\Payment_Confirmation\get_confirmation_data(); if ( empty( $data ) ) { return; } $customer = $data[‘customer’]; $email = $customer->email; if ( isset( $_GET[’email’] ) ) { return;…Continue reading

No Index Search Results

function noindex_search_results() { if ( is_search() ) { ob_start(‘add_noindex_to_search’); } } add_action( ‘template_redirect’, ‘noindex_search_results’ ); function add_noindex_to_search($buffer) { if ( preg_match(‘/Continue reading