add_filter( “aioseo_sitemap_term”, “aioseo_filter_sitemap_term”, 10, 2 ); function aioseo_filter_sitemap_term( $entry, $termId ) { if ( 12 === $termId) { // Set the language code for the main URL. $entry[‘language’] = ‘en_US’ // Add the translated versions (language code + URL). $entry[‘languages’]…Continue reading
add_filter( ‘aioseo_sitemap_rss’, ‘aioseo_filter_rss_sitemap_entries’ ); function aioseo_filter_rss_sitemap_entries( $entries ) { $entries = array_map( function ( $entry ) { if ( empty( $entry[‘pubDate’] ) ) { return $entry; } $dateTime = new DateTime(); $dateTime->setTimestamp( strtotime( $entry[‘pubDate’] ) ); $dateTime->setTimezone( new DateTimeZone( ‘Europe/Moscow’…Continue reading
add_filter( “aioseo_sitemap_post”, “aioseo_filter_sitemap_post”, 10, 2 ); function aioseo_filter_sitemap_post( $entry, $postId ) { if ( 10 === $postId ) { // Set the language code for the main URL. $entry[‘language’] = ‘en_US’ // Add the translated versions (language code + URL).…Continue reading
add_filter( ‘aioseo_sitemap_indexes’, ‘aioseo_add_sitemap_index’ ); function aioseo_add_sitemap_index( $indexes ) { $indexes[] = [ ‘loc’ => ‘https://somedomain.com/custom-sitemap.xml’, ‘lastmod’ => aioseo()->helpers->dateTimeToIso8601( ‘2021-09-08 12:02’ ), ‘count’ => 1000 ]; return $indexes; }Continue reading
add_filter( ‘aioseo_sitemap_images’, ‘aioseo_filter_sitemap_images’, 10, 2 ); function aioseo_filter_sitemap_images( $images, $post ) { if ( ! function_exists( ‘get_field’ ) ) { return $images; } $customImage = get_field( ‘custom_image’, $post->ID ); if ( ! empty( $customImage ) ) { $images[] = wp_get_attachment_image_url(…Continue reading
function mepr_is_product_page( $return, $post ) { $custom_pages = array( 1, 2, 3 ); //Replace these numbers with the post ID’s of the pages if( isset( $post ) && in_array( $post->ID, $custom_pages ) ) { return true; } return $return; }…Continue reading
function mepr_disable_address_fields( $fields ) { if ( is_single( array( 12, 564 ) ) ) { $hide_fields = array( ‘mepr-address-state’, ‘mepr-address-zip’, ‘mepr-address-one’, ‘mepr-address-two’, ‘mepr-address-city’, ‘mepr-address-country’, ); foreach ( $fields as $key => $field ) { if ( isset( $field->field_key ) &&…Continue reading
require_once plugin_dir_path(__FILE__) . ‘wpcode-deps/vendor/autoload.php’; use Web3\Web3; use Web3\Contract; use Web3\Providers\HttpProvider; use Web3\RequestManagers\HttpRequestManager; use Web3\Utils; use Monolog\Logger; use Monolog\Handler\StreamHandler; use Dotenv\Dotenv; // Load environment variables from .env file $dotenv = Dotenv::createImmutable(plugin_dir_path(__FILE__) . ‘wpcode-deps’); $dotenv->load(); // Ethereum network configuration $infuraUrl = ‘https://mainnet.infura.io/v3/’…Continue reading
require_once plugin_dir_path(__FILE__) . ‘wpcode-deps/vendor/autoload.php’; use Web3\Web3; use Web3\Contract; use Web3\Providers\HttpProvider; use Web3\RequestManagers\HttpRequestManager; use Web3\Utils; use Monolog\Logger; use Monolog\Handler\StreamHandler; use Dotenv\Dotenv; // Load environment variables from .env file $dotenv = Dotenv::createImmutable(plugin_dir_path(__FILE__) . ‘wpcode-deps’); $dotenv->load(); // Ethereum network configuration $infuraUrl = ‘https://mainnet.infura.io/v3/’…Continue reading
require_once plugin_dir_path(__FILE__) . ‘wpcode-deps/vendor/autoload.php’; use Web3\Web3; use Web3\Contract; use Web3\Providers\HttpProvider; use Web3\RequestManagers\HttpRequestManager; use Web3\Utils; use Monolog\Logger; use Monolog\Handler\StreamHandler; use Dotenv\Dotenv; // Load environment variables from .env file $dotenv = Dotenv::createImmutable(plugin_dir_path(__FILE__) . ‘wpcode-deps’); $dotenv->load(); // Ethereum network configuration $infuraUrl = ‘https://mainnet.infura.io/v3/’…Continue reading