Skip to content

Add Description under Menu Items in Total Theme

function be_header_menu_desc( $item_output, $item, $depth, $args ) { if ( 'main_menu' == $args->theme_location && ! $depth && $item->description ) { $item_output = str_replace( '</a>', '<span class="menu-item-desc">' . $item->description . '</span></a>', $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'be_header_menu_desc', 10,…

Mehr Lesen

DKPDF Customizations

This allows to change filename, layout, pagination and other stuff for the DKPF plugin. //PDF CHANGES //change filename function custom_dkpdf_pdf_filename( $filename ) { $current_user = get_the_author_meta('display_name'); $filename = 'Telekanzlei - Checkliste - '.get_the_title(); return $filename; } add_filter( 'dkpdf_pdf_filename', 'custom_dkpdf_pdf_filename' );…

Mehr Lesen

Redirect CPT for non-logged-in users

Now you can make a certain Custom Post Type invisible for guest and only accessible for registered and logged-in users. Adapt as you like this following snippet: function hide_single_property() { if( is_singular('patterns-nr') || is_page('dashboard')) { if( ! is_user_logged_in() ) {…

Mehr Lesen
you are enough text

Open Lightbox after form submission in Total Theme

//Trigger 1 #lightboxcontent https://total.wpexplorer.com/docs/adding-ilightbox-popups-inline/ //Trigger 2 /?success=confirmation https://total.wpexplorer.com/docs/snippets/trigger-lighbox-via-url/ //not needed if other lightbox elements present or do_shortcode below add_filter( 'wpex_load_ilightbox_globally', '__return_true' ); add_action( 'wp_footer', function() { //do_shortcode('[vcex_button onclick="popup" text_source="custom_text" onclick_lightbox_title="" onclick_lightbox_caption="" unique_id="confirmation" onclick_url="#lightboxcontent" onclick_lightbox_dims="450x330" visibility="hidden"]Lightbox[/vcex_button]'; ?> <a href="#lightboxcontent" id="confirmation" class="wpex-lightbox…

Mehr Lesen

Changing the page title in WordPress

//CHANGE POST TITLE function custom_modify_title( $title, $id = null ) { return 'CUSTOM '.$title; } add_filter( 'wp_title', 'custom_modify_title', 10, 2 ); add_filter( 'the_title', 'custom_modify_title', 10, 2 ); Change depending on post type //CHANGE POST TITLE add_filter('the_title','custom_modify_title2'); function custom_modify_title2($data){ global $post;…

Mehr Lesen

Add custom Icon Shortcode

//LOAD LINEARICONS (you need the webfont and the css) /* function enym_linearicons_css(){ wp_enqueue_style( 'linearicons', get_stylesheet_directory_uri() . '/css/linearicons.min.css' ); } add_action( 'wp_enqueue_scripts', 'enym_linearicons_css', 99 ); */ //ADD LINEARICONS SHORTCODE function enym_icon_shortcode( $atts ) { $atts = shortcode_atts( array( 'icon' => '',…

Mehr Lesen
An den Anfang scrollen