server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass %backend_lsnr%;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
include %home%/%user%/web/%domain%/stats/auth.conf*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
}
npm init
, потом npm i gulp --save-dev
gulp
(если есть таск "default") и всё, он начинает работу. Если у вас вместо таска default, допустим, какое-то другое имя, то пишем в консоли то же самое, только в конец добавляем имя таска gulp имя_таска
<input type="text" required oninvalid="this.setCustomValidity('Wow')" oninput="setCustomValidity('')" />
register_taxonomy(
'type_work',
'portfolio',
array(
'rewrite' => array( 'slug' => 'portfolio', 'with_front' => false )
)
);
register_post_type(
'portfolio',
array(
'rewrite' => array( 'slug' => 'portfolio/%type_work%', 'with_front' => false ),
'has_archive' => 'portfolio'
)
);
function wpa_portfolio_permalinks( $post_link, $post ){
if ( is_object( $post ) && $post->post_type == 'portfolio' ){
$terms = wp_get_object_terms( $post->ID, 'type_work' );
if( $terms ){
return str_replace( '%type_work%' , $terms[0]->slug , $post_link );
}
}
return $post_link;
}
add_filter( 'post_type_link', 'wpa_portfolio_permalinks', 1, 2 );
$loop = new WP_Query( array(
'category_name' => 'имя_категории',
'post_type' => 'product',
'posts_per_page' => 40,
'orderby' => 'menu_order',
'order' => 'ASC',
));
////////////////
function my_styles() {
if ( is_page( 933 ) ) {
//подключаем стиль
wp_enqueue_style ( 'contact', get_template_directory_uri()
. '/altercss.css', array(), '1.0' );
//подключаем скрипт
wp_enqueue_script('alterscript', get_template_directory_uri() . '/alterscript.js');
}
}
add_action( 'wp_enqueue_scripts', 'my_styles' );
//////////////////