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 | |
/* 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
<?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 | |
// 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 | |
/* 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 | |
/** | |
* Remove woocomerce product data tabs | |
* @origin https://wp-pro.dk/guides/tilpas-woocommerce-faneblades-titel-og-overskrift | |
*/ | |
add_filter( 'woocommerce_product_tabs', 'eid_remove_product_tabs', 98 ); | |
function eid_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab |
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 | |
// #Adjusting Autoptimize warning limit to 1GB | |
add_filter('autoptimize_filter_cachecheck_maxsize','adjust_cachesize'); | |
function adjust_cachesize() { | |
return 1024*512*1024; | |
} |
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
/** better solution | |
* description on https://wp-pro.dk/?p=3656 | |
**/ | |
:target { scroll-margin-top:75px} | |
/** old solution - don't use this! **/ | |
body:not(.elementor-editor-active) /* for not messsing up elementor editor */ | |
*[id]:before { | |
content: ""; | |
display:block; |