add_filter( ‘aioseo_canonical_url’, ‘aioseo_filter_canonical_url’ ); function aioseo_filter_canonical_url( $url ) { if (strpos($_SERVER[‘REQUEST_URI’],’/home-search/listing/’) !== false) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); if (strpos($url,’?’) !== false){ $url = substr( $url, 0, strpos($url,’?’) ); } } return $url; }Continue reading
function wpcode_custom_modified_column_register( $columns ) { $columns[‘last_modified’] = __( ‘Last Modified’, ‘wpcode’ ); return $columns; } add_filter( ‘manage_edit-post_columns’, ‘wpcode_custom_modified_column_register’ ); function wpcode_custom_modified_column_display( $column_name, $post_id ) { if ( ‘last_modified’ != $column_name ) return; echo the_modified_date(); } add_action( ‘manage_posts_custom_column’, ‘wpcode_custom_modified_column_display’, 10, 2…Continue reading
function wpcode_custom_remove_admin_menus(){ // Replace “user_role” with the user role you want to target. if ( ! current_user_can( ‘user_role’) ) { return; } // Hide the comments page. remove_menu_page( ‘edit-comments.php’ ); // Hide WooCommerce page. remove_menu_page( ‘woocommerce’ ); // Hide the…Continue reading
function wpcode_custom_hide_plugins() { // Replace “administrator” with the user role you want to target. if ( ! current_user_can( ‘administrator’ ) ) { return; } // Modify the array to match the plugins you want to hide. $plugins_to_hide = array( ‘plugin-slug/plugin-file.php’,…Continue reading
add_filter( ‘aioseo_description’, ‘aioseo_filter_description’ ); function aioseo_filter_description( $description ) { if ( strlen($description) > 160 ) { $description = substr($description, 0, 159); } return $description; }Continue reading
add_filter( ‘aioseo_title’, ‘aioseo_filter_title’ ); function aioseo_filter_title( $title ) { if ( strlen($title) > 60 ) { $title = substr($title, 0, 60); } return $title; }Continue reading
add_action( ‘init’, function() { if ( function_exists( ‘aioseo’ ) ) { aioseo()->preUpdates->createCacheTable(); } });Continue reading
add_filter( ‘aioseo_schema_woocommerce_shipping_disable’, ‘__return_true’ );Continue reading
function afwerx_redirect() { if (isset($_SERVER[‘HTTPS’]) && ($_SERVER[‘HTTPS’] == ‘on’ || $_SERVER[‘HTTPS’] == 1) || isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) && $_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) { $protocol = ‘https://’; } else { $protocol = ‘http://’; } $currenturl = $protocol . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]; $currenturl_relative = wp_make_link_relative($currenturl);…Continue reading