add_filter('woocommerce_single_product_image_html','remove_link_on_thumbnail' ); function remove_link_on_thumbnail($html){ return strip_tags($html,'<img>'); }
add_action( 'admin_menu', 'rename_woocoomerce_wpse_100758', 999 ); function rename_woocoomerce_wpse_100758() { global $menu; $woo = recursive_array_search_php_91365( 'WooCommerce', $menu ); if( !$woo ) return; $menu[$woo][0] = 'Store Settings'; } function recursive_array_search_php_91365( $needle, $haystack ) { foreach( $haystack as $key => $value ) { $current_key = $key; if( $needle === $value OR ( is_array( $value ) && recursive_array_search_php_91365( $needle, $value ) !== false ) ) { return $current_key; } } return false; }
<!-- Force https --> <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
/* Set posts per page for a custom post type in wordpress.php */ function set_posts_per_page_for_towns_cpt( $query ) { if ( !is_admin() && $query->is_main_query() && is_post_type_archive( 'towns' ) ) { $query->set( 'posts_per_page', '10' ); } } add_action( 'pre_get_posts', 'set_posts_per_page_for_towns_cpt' );
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; query_posts( array( 'post_type' => 'YourPostType', 'YourTax' => 'YourTaxTerm', 'showposts' => 8, 'orderby' => 'date', 'order' => 'DESC', 'post_status'=> 'publish', 'ignore_sticky_posts' => 1, 'paged' => $paged ) ); if (have_posts()) : while (have_posts()) : the_post(); the_title() endwhile; endif; wp_reset_query();
// Add Custom post types to tags and categories archives function add_cpts_to_archive_page( $query ) { if( (is_category() || is_tag()) && $query->is_archive() && empty( $query->query_vars['suppress_filters'] ) ) { $query->set( 'post_type', array( 'post', 'custom-post-type-1', 'custom-post-type-2' )); } return $query; } add_filter( 'pre_get_posts', 'add_cpts_to_archive_page' );
Loading...
No more items to load
My website may contain fan art inspired by existing characters from movies or tv shows, I dont own any rights. Any copyright owner willing to remove those fan arts can contact me here. This is a personal portfolio, the sole use of cookies are for analysing my traffic through Google Analytics, if you're ok with that please accept this terms by closing this disclaimer.