This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Чтобы работала штатная пагинация надо в массив запрос добавить параметр 'paged'=>$paged*/ | |
$myquery = new WP_Query(['cat' => $cat_id, 'orderby' => 'date', 'order' => 'ASC', 'paged'=>$paged]); | |
if ($myquery -> have_posts()) : ?> | |
<?php while ($myquery -> have_posts()) : $myquery -> the_post(); ?> | |
<?php echo the_post_thumbnail( [355,148] ); ?> | |
<h3><?php the_title() ?></h3> | |
<?php the_excerpt(); ?> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title() ?>">УЗНАТЬ БОЛЬШЕ</a> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The WordPress Loop | |
<?php if ( have_posts ) : ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<?php if ( 'gallery' == get_post_format( get_the_ID() ) ) : ?> | |
<!-- Layout your gallery here --> | |
<?php else : ?> | |
<!-- Layout your standard posts here --> | |
<?php endif; ?> | |
<?php endwhile; ?> | |
<?php else : ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $post; | |
global $wp_query; | |
$currentPageCatId = get_cat_ID( "pagename" ); | |
$NewsCatPostsArray = query_posts( 'cat='.$currentPageCatId); | |
$current_news_postId = $NewsCatPostsArray[$i]->ID; | |
$current_news_postUrl = get_permalink($current_news_postId); | |
$query_images_args = array('post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,'post_parent' => $current_news_postId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Make Home Directory for SShH keys. | |
c://users/UserName/.SSH (for Windows 7) | |
2. Generate SSH key by command: | |
ssh-keygen -t rsa -C "[email protected]" | |
# Creates a new ssh key, using the provided email as a label | |
Generating public/private rsa key pair. | |
It's created a pair of keys - private and public in home dir .SSH | |
C:\Users\SuvorovAG\.ssh\id_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Структура = Новый Структура; | |
Для каждого Элемент Из Структура Цикл | |
Сообщить("{" + Элемент.Ключ + ":" + Элемент.Значение + "}") | |
КонецЦикла; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Структура = Новый Структура; | |
Для каждого Элемент Из Структура Цикл | |
Сообщить("{" + Элемент.Ключ + ":" + Элемент.Значение + "}") | |
КонецЦикла; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Функция СтрокаВыборкиВJsonФормате(СтрокаВыборки,КолонкиВыборки) | |
JsonСтрока = "Строка в Json"; | |
НомерКолонки = 0; | |
Пока НомерКолонки <= КолонкиВыборки.Количество()-1 Цикл | |
JsonСтрока = ?(НомерКолонки = 0,"{",JsonСтрока + ", ") + | |
Символ(34) +КолонкиВыборки.Получить(НомерКолонки).Имя + Символ(34) + ": " + Символ(34) + | |
ПодготовитьДанныеДляВыгрузки(СтрокаВыборки.Получить(НомерКолонки)) + Символ(34) + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- \<NamespaceName>(\<SubNamespaceNames>)*\<ClassName> | |
- The fully qualified class name MUST have a top-level namespace name, also known as a "vendor namespace". | |
- Alphabetic characters in the fully qualified class name MAY be any combination of lower case and upper case. | |
Sample: | |
FULLY QUALIFIED CLASS NAME NAMESPACE PREFIX BASE DIRECTORY RESULTING FILE PATH | |
\Acme\Log\Writer\File_Writer Acme\Log\Writer ./acme-log-writer/lib/ ./acme-log-writer/lib/File_Writer.php | |
\Zend\Acl Zend /usr/includes/Zend/ /usr/includes/Zend/Acl.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Files MUST(ОБЯЗАНЫ) use only <?php and <?= tags. | |
2. Class MUST(ОБЯЗАНЫ) name - StudlyCaps() | |
каждое слово с большой буквы | |
3. Constant MUST(ОБЯЗАНЫ) - MY_CONSTANT_NAME | |
upper case with under score separators (верхний регистр , нижние подчёркивания) | |
const DATE_APPROVED = '2012-06-01'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHPStorm Ctrl+Alt+Shift+L | |
Цель данных рекомендаций – снижение сложности восприятия кода, написанного разными авторами | |
1,2 - пропущены | |
3. namespases, use | |
<?php | |
namespace Vendor\Package; | |
use FooClass; |