This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Remove unneccesary default widgets from backend | |
* Comment out what you wish to see | |
*/ | |
function unregister_default_widgets() { | |
unregister_widget('WP_Widget_Pages'); | |
unregister_widget('WP_Widget_Calendar'); | |
unregister_widget('WP_Widget_Archives'); | |
unregister_widget('WP_Widget_Links'); | |
unregister_widget('WP_Widget_Meta'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Remove unused Woocommerce widgets */ | |
function eid_unregister_woo_widgets() { | |
// unregister_widget( 'WC_Widget_Recent_Products' ); | |
unregister_widget( 'WC_Widget_Featured_Products' ); | |
// unregister_widget( 'WC_Widget_Product_Categories' ); | |
unregister_widget( 'WC_Widget_Product_Tag_Cloud' ); | |
unregister_widget( 'WC_Widget_Cart' ); | |
// unregister_widget( 'WC_Widget_Layered_Nav' ); | |
// unregister_widget( 'WC_Widget_Layered_Nav_Filters' ); | |
unregister_widget( 'WC_Widget_Price_Filter' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* WooCommerce - add SKU on cat pages */ | |
add_action( 'woocommerce_after_shop_loop_item_title', 'shop_sku', 5 ); | |
function shop_sku(){ | |
global $product; | |
echo '<span itemprop="productID" class="sku">' . __('SKU', 'woocommerce'). ': ' . $product->sku . '</span>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('icl_ls_languages', 'wpml_ls_filter'); | |
function wpml_ls_filter($languages) { | |
global $sitepress; | |
$default_url = $languages[$sitepress->get_default_language()]['url']; | |
foreach($languages as $lang_code => $language){ | |
if($languages[$lang_code]['missing']==1){ | |
$languages[$lang_code]['url'] = $default_url; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* This will change the heading (H2:Decstiption) within the description tab to product name | |
* @origin https://wp-pro.dk/guides/tilpas-woocommerce-faneblades-titel-og-overskrift | |
*/ | |
add_filter( 'woocommerce_product_description_heading', 'eid_change_product_description_tab_heading', 10, 1 ); | |
function eid_change_product_description_tab_heading( $title ) { | |
global $post; | |
return $post->post_title; //change to "" to remove text | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Functions for my website | |
Plugin URI: https://wp-pro.dk/lav-dit-eget-funktionsplugin/ | |
Description: Special functions for this website without their own plugin | |
Version: 1.5 | |
Author: Ellegaard ID | |
Author URI: http://www.eid.dk | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* This will change the title (Description) of the description tab to something else | |
* @origin https://wp-pro.dk/guides/tilpas-woocommerce-faneblades-titel-og-overskrift | |
*/ | |
add_filter( 'woocommerce_product_tabs', 'eid_change_product_description_tab_title', 10, 1 ); | |
function eid_change_product_description_tab_title( $tabs ) { | |
global $post; | |
if ( isset( $tabs['description']['title'] ) ) | |
$tabs['description']['title'] = __('Event information', 'txt_domain'); // change for something else, ready for translation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This wil cheange the title (Description) of the description tab to product name | |
add_filter( 'woocommerce_product_tabs', 'eid_change_product_description_tab_title', 10, 1 ); | |
function eid_change_product_description_tab_title( $tabs ) { | |
global $post; | |
if ( isset( $tabs['description']['title'] ) ) | |
$tabs['description']['title'] = $post->post_title; | |
return $tabs; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* creating custom post type for frontpage slider | |
* By ellegaard ID - www.eid.dk | |
*/ | |
add_action('init', 'create_frontpagepic'); | |
function create_frontpagepic() { | |
$feature_args = array( | |
'labels' => array( | |
'name' => __( 'Forsidebilleder' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function change_default_title( $title ){ | |
$screen = get_current_screen(); | |
if ( $screen->post_type == 'your_custom_post_type' ) { | |
return __( Skriv din egen tekst her', 'lang_domain' ); | |
} | |
} | |
add_action('init', 'change_default_title'); |