Skip to content

Shortcode to show current page title

function title_func($atts) { extract( shortcode_atts( array( 'num_words' => 20, ), $atts ) ); //$title = get_the_title(get_the_ID()); $title = substr(get_the_title(), 0, $num_words ); $length = strlen(get_the_title()); if ($length > $num_words) { $more = "…"; } else { $more = ""; }…

Mehr Lesen

Shortcode to show current search term

//=================================================== //SHORTCODE: SEARCH TERM //=================================================== add_shortcode( 'search_term', function( $atts = null, $content = null ) { return $_GET['s'].$_GET['wpv_post_search']; } );

Mehr Lesen

Reload current opage shortcode

I have placed this in a form response to trigger a page reload. function reload_page_shortcode( $atts = null, $content = null ) { /* $output = <<<EOF <div id="reload-shortcode-app"> <select class="browser-default" v-model="qParams"> <option value="">Default</option> $content </select> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.9/vue.min.js"></script> <script>…

Mehr Lesen

Add MyAlice Chatbot to WordPress

/* //ADD MYALICE function my_footer_script() { ?> <script> // Put this code snippet inside script tag (function () { var div = document.createElement('div'); div.id = 'icWebChat'; var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true; script.src = 'https://webchat.getalice.ai/index.js'; var…

Mehr Lesen

Add custom field as column for admin table for a custom post type

// Add the custom columns to the book post type: add_filter( 'manage_ausstellung_posts_columns', 'set_custom_edit_ausstellung_columns' ); function set_custom_edit_ausstellung_columns($columns) { //unset( $columns['author'] ); $columns['enym_artist'] = __( 'Künstler', 'enym' ); return $columns; } // Add the data to the custom columns for the book…

Mehr Lesen

Apple Custom Typography to other font elements in total theme

add_filter( 'wpex_typography_settings', function( $settings ) { if ( isset( $settings['entry_h1'] ) ) { $settings['entry_h1']['target'] = 'h1, .wpex-h1, .vcex-module h1, h1.vcex-heading'; } if ( isset( $settings['entry_h2'] ) ) { $settings['entry_h2']['target'] = 'h2, .wpex-h2, .vcex-module h2, h2.vcex-heading'; } if ( isset( $settings['entry_h3']…

Mehr Lesen
An den Anfang scrollen