Skip to content
black Android smartphone

Simple Self Closing Shortcode Example

//self enclosing shortcode use as [subtitle class="css-class"]TEXT[/subtitle] //https://www.hostinger.com/tutorials/create-a-shortcode-in-wordpress function subtitle_link_att($atts, $content = null) { $default = array( 'class' => '', ); $a = shortcode_atts($default, $atts); $content = do_shortcode($content); return '<div class="'.($a['class']).'">'.$content.'</div>'; } add_shortcode('subtitle', 'subtitle_link_att'); //[subtitle class="subtitle"]Link[/subtitle]

Mehr Lesen
two people drawing on whiteboard

SPF Record bei HostEurope vornehmen

SPF für E-Mail-Hosting, Webhosting, Webserver und Microsoft 365 Hinweis: Wenn Ihre Domain per A-Record auf einen externen Server verweist, ergänzen Sie den SPF-Eintrag bitte um die IP-Adresse des externen Servers. Hierzu ein Beispiel, wobei die externe IP-Adresse in diesem Beispiel 1.2.3.4…

Mehr Lesen
blue, red, and yellow flag

CSS: German Flag Footer

Use this HTML: <div class="german">&nbsp;</div> CSS .german { background: #000000; background: -moz-linear-gradient(left, #000000 0%, #000000 66%, #cc0018 66%, #cc0018 85%, #f0c400 85%); background: -webkit-linear-gradient(left, #000000 0%, #000000 66%, #cc0018 66%, #cc0018 85%, #f0c400 85%); background: linear-gradient(to right, #000000 0%, #000000…

Mehr Lesen

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
An den Anfang scrollen