{
"name": "site-webstie-wordpress",
"version": "1.0.0",
"scripts": {
"sitepress-start": "init-site.sh",
"vp-pull": "docker exec -ti -u www-data wordpressweb wp vp pull",
"git-commit": "docker exec -ti -u www-data wordpressweb bash",
"git-push": "docker exec -u www-data wordpressweb git push --set-upstream origin master",
"lint": "nopenv pre-commit run --all-files",
"install": "npip install",
"docker-all-containers": "docker container ls --all",
"docker-all-images": "docker image ls",
"docker-all-processes": "docker ps",
"docker-stats": "docker stats",
"docker-prune": "docker system prune -f && docker volume prune -f",
"sitepress-build": "docker build -t sitepress docker-site.com/",
"wordpressweb-logs": "docker logs wordpressweb",
"wordpressdb-logs": "docker logs wordpressdb"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*": [
"nopenv pre-commit run --files"
]
},
"devDependencies": {
"gulp-util": "^3.0.8",
"husky": "^3.0.4",
"lint-staged": "^9.2.3",
"nopy": "^0.2.7"
},
"python": {
"dependencies": {
"pre-commit": ">=1.18"
}
}
}
"sitepress-start": "init-site.sh",
поправить нужно будет:
- переписать пути в командах docker cp на виндовые
- возмжно нужно добавить шареные диски в docker desktop чтобы папки из которых копируете файлы в контейнер были доступны контейнеру (а может быть и не надо, я с docker cp практически не работал)
docker cp ~/.ssh/id_rsa wordpressweb:/var/www/.ssh/
docker cp ~/.ssh/known_hosts wordpressweb:/var/www/.ssh/
docker cp C:/Users/DELUX/.ssh/id_rsa wordpressweb:/var/www/.ssh/
docker cp C:/Users/DELUX/.ssh/known_hosts wordpressweb:/var/www/.ssh/
docker exec -u www-data wordpressweb git fetch
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/var/www/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/var/www/.ssh/id_rsa": bad permissions
git@git.site.tech: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
[cases-list category="products" ids="298, 7, 194" order="ASC" orderby="title"]
[cases-list category="products" ids="298,7,194"]
// Shortcode for cases [cases-list posts="3"]
add_shortcode( 'cases-list', 'cases_posts_listing_parameters_shortcode' );
function cases_posts_listing_parameters_shortcode( $atts ) {
ob_start();
$args = shortcode_atts( array (
'type' => 'post',
'ids' => array(),
'order' => 'date',
'orderby' => 'title',
'posts' => -1,
'category' => '',
// 'post_status' => 'publish',
'public' => true,
), $atts );
$options = array(
'post_type' => $args['type'],
'post__in' => explode(',', $args['ids']), // 298,7,194
'order' => $args['order'],
'orderby' => $args['orderby'],
'posts_per_page' => $args['posts'],
'category_name' => $args['category'],
'post__not_in' => array( get_the_ID() ),
'post_status' => 'publish'
);
$query = new WP_Query( $options );
if ( $query->have_posts() ) { ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<?php
get_template_part( 'template-parts/content/content-case', get_post_format() );
?>
<?php endwhile;
wp_reset_postdata(); ?>
<?php $myvariable = ob_get_clean();
return $myvariable;
}
}
add_shortcode( 'cases-list', 'cases_posts_listing_parameters_shortcode' );
function cases_posts_listing_parameters_shortcode( $atts ) {
ob_start();
$args = shortcode_atts( array (
'type' => 'post',
'ids' => '',
'order' => 'date',
'orderby' => 'title',
'posts' => -1,
'category' => '',
// 'post_status' => 'publish',
'public' => true,
), $atts );
$options = array(
'post_type' => $args['type'],
'post__in' => array($args['ids']), // 298,7,194
'order' => $args['order'],
'orderby' => $args['orderby'],
'posts_per_page' => $args['posts'],
'category_name' => $args['category'],
'post__not_in' => array( get_the_ID() ),
'post_status' => 'publish'
);
[cases-list category="products" ids="298,7,194"]
давайте. только не забудьте дополнить, что я не когда не позиционировал себя как проф. разработчика.
это для профессионалов ВП ...
add_shortcode( 'cat-articles', 'cat_articles_listing_parameters_shortcode' );
function cat_articles_listing_parameters_shortcode( $atts ) {
ob_start();
$args = shortcode_atts( array (
'type' => 'post',
'order' => 'date',
'orderby' => 'title',
'posts' => -1,
'color' => '',
'category' => '',
'public' => true,
), $atts );
$options = array(
'post_type' => $args['type'],
'order' => $args['order'],
'orderby' => $args['orderby'],
'posts_per_page' => $args['posts'],
'color' => $args['color'],
'category_name' => $args['category'],
'post__not_in' => $post->ID,
'post_status' => 'publish'
);
'post__not_in' => $post->ID,