if (the_ID == 48777) {
Тут свой тайтл
}
else {
the_title()
}
/*сворачиваем комменты*/
$(".children").after("<a href='#' class='collapce_comment'>Развернуть</a>");
$('.collapce_comment').click(function(){
$(this).closest('.comment').find('.children').slideToggle(300, function(){
if ($(this).is(':hidden')) {
$(this).parent().find('.collapce_comment').html('Развернуть');
} else {
$(this).parent().find('.collapce_comment').html('Свернуть');
}
});
return false;
});
function kurs_comment( $comment, $args, $depth ){
?><div <?php comment_class() ?> id="comment-<?php comment_ID() ?>">
<div class="comment-body">
<?php echo get_avatar( $comment, 60, '', '', array( 'class' => 'comment-avatar' ) ) ?>
<div class="comment-content">
<span class="comment-author"><?php comment_author() ?></span>
<span class="comment-date"><?php comment_date( 'j F Y в H:i' ) ?></span>
<div class="comment_body"><?php comment_text() ?></div>
</div>
</div>
<?php // без закрывающего </div> (!)
}
function kurs_end_comment( $comment, $args, $depth ){
echo '</div>';
}
wp_list_comments( array(
'callback' => 'misha_comment',
'end-callback' => 'misha_end_comment'
) );
<?php
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 6,
'orderby' => 'date',
'paged' => $paged,
'order' => 'DESC',
);
$q = new WP_Query($args);
?>
$rand_index = wp_rand( 0, max );
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6221
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/includes/misc.php on line 1282
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-header.php on line 9
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6221
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/includes/misc.php on line 1282
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-header.php on line 9
[05-Aug-2020 10:37:56 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1281
[05-Aug-2020 10:37:56 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1284
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1281
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1284
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/http.php on line 494
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/http.php on line 495
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-ajax.php on line 27
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-ajax.php on line 28
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6107
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6221
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/includes/misc.php on line 1282
/**
* Вывод атрибутов на странице товара
*/
function productFeature() {
global $post;
$attribute_names = array( 'pa_razmer-domika', 'pa_materialy' );
foreach ( $attribute_names as $attribute_name ) {
$taxonomy = get_taxonomy( $attribute_name );
if ( $taxonomy && ! is_wp_error( $taxonomy ) ) {
$terms = wp_get_post_terms( $post->ID, $attribute_name );
$terms_array = array();
if ( ! empty( $terms ) ) {
foreach ( $terms as $term ) {
$archive_link = get_term_link( $term->slug, $attribute_name );
$full_line = '<a href="' . $archive_link . '">'. $term->name . '</a>';
array_push( $terms_array, $full_line );
}
echo '<span class="attribute">' . $taxonomy->labels->name . ' ' . implode( $terms_array, ', ' ). '</span>';
}
}
}
}
// Определяем место вывода атрибута
add_action('woocommerce_single_product_summary', 'productFeature', 7);
$product_tabs = apply_filters( 'woocommerce_product_tabs', array() );
if ( ! empty( $product_tabs ) ) : ?>
<div class="row">
<?php foreach ( $product_tabs as $key => $product_tab ) : ?>
<div class="col-6">
<?php
if ( isset( $product_tab['callback'] ) ) {
call_user_func( $product_tab['callback'], $key, $product_tab );
}
?>
</div>
<?php endforeach; ?>
<?php do_action( 'woocommerce_product_after_tabs' ); ?>
</div>
<?php endif; ?>
<?php
$parent_id = 5;
echo '<h2>Услуги</h2>';
# получаем дочерние рубрики
$sub_cats = get_categories( array(
'child_of' => $parent_id,
'hide_empty' => 0
) );
if( $sub_cats ){
foreach( $sub_cats as $cat ){
// Данные в объекте $cat
// $cat->term_id
// $cat->name (Рубрика 1)
// $cat->slug (rubrika-1)
// $cat->term_group (0)
// $cat->term_taxonomy_id (4)
// $cat->taxonomy (category)
// $cat->description ()
// $cat->parent (0)
// $cat->count (14)
// $cat->object_id (2743)
// $cat->cat_ID (4)
// $cat->category_count (14)
// $cat->category_description ()
// $cat->cat_name (Рубрика 1)
// $cat->category_nicename (rubrika-1)
// $cat->category_parent (0)
echo '<h3>'. $cat->name .'</h3>';
# получаем записи из рубрики
$myposts = get_posts( array(
'numberposts' => -1,
'category' => $cat->cat_ID,
'orderby' => 'post_date',
'order' => 'DESC',
) );
# выводим записи
global $post;
foreach($myposts as $post){
setup_postdata($post);
echo '<li><a href="'. get_permalink() .'">'. get_the_title() .'</a></li>';
}
}
wp_reset_postdata(); // сбрасываем глобальную переменную пост
}