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 eid_cpt_employee() { | |
register_post_type( 'eid_team_member', | |
array( | |
'labels' => array( | |
'name' => __( 'Medarbejdere', 'eid_function' ), | |
'singular_name => __( 'Medarbejder', 'eid_function' ), | |
), | |
'description' => __( 'Virksomhedens medarbejdere', 'eid_function' ), | |
'public' => true, | |
'has_archive' => true, |
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 | |
/* | |
* Custom queries for Elementor | |
* by ellegaard ID | |
*/ | |
/* Get direct children of current page | |
* | |
* for query ID use 'pages_direct_child_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
<?php | |
$id = get_post($post->ID); | |
$tax = get_the_terms($id, 'position'); | |
$args = array( | |
'post_type' => 'people', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'position', | |
'field' => 'slug', | |
'terms' => $tax[0]->slug, |
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; |
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
<?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 | |
/** | |
* 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 | |
/* 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; | |
} |
NewerOlder