Skip to content

Total Theme: Change Breadcrumb trail

/*CHANGE BREADCRUMBS*/ function myprefix_tweak_breadcrumbs( $trail ) { global $post; if (get_post_type( $post->ID ) == "expertenprofil") { $trail['trail_end'] = get_post_meta($post->ID, 'wpcf-anonymer-titel', true); return $trail; } } add_filter( 'wpex_breadcrumbs_trail', 'myprefix_tweak_breadcrumbs' );

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

Total Theme: Trigger Modal via URL or Button

//Trigger 1 Button #lightboxcontent https://total.wpexplorer.com/docs/adding-ilightbox-popups-inline/ //Trigger 2 URL /?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"…

Mehr Lesen

Total Theme: Get Group/ Repeater Fields with a Shortcode

add_shortcode( 'raz_keywords', function() { $html = ''; $keywords_group = get_post_meta( get_the_ID(), 'raz_keywords', true ); if ( is_array( $keywords_group ) ) { foreach ( $keywords_group as $group ) { if ( ! empty( $group['raz_unique_key_word'] ) ) { $html .= '<div>' .…

Mehr Lesen

TOTAL Theme: Create Image Gallery Meta Box for Custom Post Types

/** * Add meta boxes to selected post types * * @since 1.0 */ function easy_image_gallery_2_add_meta_box() { $post_types = array('ausstellung');//easy_image_gallery_2_allowed_post_types(); if ( ! $post_types ) { return; } foreach ( $post_types as $post_type => $status ) { add_meta_box( 'easy_image_gallery_2', esc_html__(…

Mehr Lesen

Sortable Filesize Column in Media Library

/* ------------------------------ MEDIA METADATA ------------------------------ */ // edits image meta data add_action( 'add_attachment', 'my_edit_image_meta_data' ); function my_edit_image_meta_data( $post_ID ) { // checks if the uploaded file is an image if ( wp_attachment_is_image( $post_ID ) ) { // finds the total…

Mehr Lesen

Update some meta for all media library items

Only run this once! uncomment the "add_action" then open site and then comment it out again. Watch your timeout depending on how many images you have. /* * Update ALL attachments metada with Width and Height * * Important: Run…

Mehr Lesen
An den Anfang scrollen