This file contains 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
$posts = get_posts([ 'category_name' => 'about_features', // slug или name категории | |
'numberposts' => '-1' ]); // кол-во постов -1 без лимита, 0 лимит заданный в админке | |
function post_by_slug($posts, $slug) { | |
for ($x = 0, $len = count( $posts ); $x < $len; $x++) { | |
if ($posts[$x]->post_name == $slug) { | |
return $posts[$x]; | |
} | |
} | |
return false; |
This file contains 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 | |
$args = array( | |
'orderby' => 'ID', | |
'order' => 'ASC', | |
'post_type' => 'instructor', | |
'post_status' => 'publish', | |
); | |
$loop = new WP_Query( $args ); | |
?> | |
<?php while ( $loop->have_posts() ) : $loop->the_post();?> |
This file contains 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
// html или tinymce | |
// Установим визуальный редактор, редактором по умолчанию | |
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') ); | |
// Установим HTML (текстовый) редактор, редактором по умолчанию | |
add_filter( 'wp_default_editor', create_function('', 'return "html";') ); |
This file contains 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 echo wp_trim_words(get_the_excerpt(), 50) ?> |
This file contains 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
history.pushState('', document.title, window.location.pathname); |
OlderNewer