Skip to content
time lapse photography of tunnel

Tutorial: Enable gzip compression in nginx on a Plesk for more speed and smaller file size

Log in to Plesk. Go to Domains > example.com > Hosting & DNS > Apache & nginx Settings. Add the following directives to the Additional nginx directives field: gzip on; gzip_disable "MSIE [1-6]\\.(?!.*SV1)"; gzip_proxied any; gzip_comp_level 5; gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/rss+xml text/javascript image/x-icon image/bmp image/svg+xml;…

Mehr Lesen

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