Add the following line to the settings "workbench.editor.enablePreview": false
"blade.format.enable": true
"phpfmt.psr2":false,
"phpfmt.exclude": [
### marker BROWSER CACHE start ### | |
<IfModule mod_expires.c> | |
ExpiresActive on | |
ExpiresByType application/pdf A31557600 | |
ExpiresByType image/x-icon A31557600 | |
ExpiresByType image/vnd.microsoft.icon A31557600 | |
ExpiresByType image/svg+xml A31557600 | |
ExpiresByType image/jpg A31557600 | |
ExpiresByType image/jpeg A31557600 |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
php wp-cli.phar --info | |
chmod +x wp-cli.phar | |
sudo mv wp-cli.phar /usr/local/bin/wp |
v-change-sys-hostname somedomain.com | |
v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'yes' | |
# v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'no'#mail domain = no | |
v-update-host-certificate admin $HOSTNAME | |
echo "UPDATE_HOSTNAME_SSL='yes'" >> /usr/local/vesta/conf/vesta.conf |
apt-get update | |
apt install apt-transport-https ca-certificates | |
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |
sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list' | |
apt-get update | |
a2enmod proxy_fcgi setenvif | |
apt-get install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-soap php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip | |
update-rc.d php7.0-fpm defaults |
static function initialize( $theme_config, $capability = 'edit_theme_options', $option_type = 'theme_mod' ) { | |
if ( class_exists( 'Kirki' ) ) { | |
\Kirki::add_config( $theme_config, array( | |
'capability' => $capability, | |
'option_type' => $option_type, | |
) ); | |
self::set_theme_config( $theme_config ); | |
} | |
} |
//Get a single category name with id, name pair | |
function get_single_category( $post_id = null ) { | |
global $post; | |
$post_id = is_null( $post_id ) ? $post->ID : $post_id; | |
$categories = wp_get_post_categories( $post_id, array( 'fields' => 'all' ) ); | |
shuffle( $categories ); | |
$single_category = array_shift( $categories ); | |
return array($single_category->term_id => $single_category->name); |
<?php | |
global $wpdb; | |
$_posts = $wpdb->get_results("SELECT ID, post_title from {$wpdb->prefix}posts WHERE post_status='publish' and post_type='post'",ARRAY_A); | |
$p = []; | |
foreach($_posts as $_post){ | |
$p[$_post['ID']] = $_post['post_title']; | |
} | |
//now pass this $p array to carbon field's set_option() function |
<?php | |
add_filter( 'the_content', function ( $content ) { | |
global $post; | |
if ( is_singular() && strpos( $post->post_content, '<!--more-->' ) ) { | |
$_content = $post->post_content; | |
$_content = str_replace("<!-- wp:more -->",'',$_content); | |
$_content = str_replace("<!-- /wp:more -->",'',$_content); | |
return str_replace("<!--more-->","<p>##HELLO-HELLO##</p>",$_content); | |
} | |
return $content; |
{ | |
"phpfmt.psr2":false, | |
"phpfmt.exclude": [ | |
"AllmanStyleBraces" | |
] | |
} |