13ответ(ов) в теме
Здравствуйте. Можете использовать свой шаблон
Вы только посмотрите как в archive.php дочернего шаблона hueman-child сделано - там вписан вызов фильтра заданий перед циклом
<?php if(is_post_type_archive('task')||is_tax('task-subject')) get_freelance_task_filter(); ?>- так же и в своем активном шаблоне впишите
Не уверен что это этот файл, потому что в шаблоне отсутствует код - но поиск выводится.
Строки с 100 по 200 по идее тут происходит всё действо
/****************************************************************************************/
if ( ! function_exists( 'interface_theloop_for_archive' ) ) :
/**
* Fuction to show the archive loop content.
*/
function interface_theloop_for_archive() {
global $post;
if( have_posts() ) {
while( have_posts() ) {
the_post();
do_action( 'interface_before_post' );
?>
<section id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action( 'interface_before_post_header' ); ?><?php if(is_post_type_archive('task')||is_tax('task-subject')) get_freelance_task_filter(); ?>
<article>
<?php
if( has_post_thumbnail() ) {
$image = '';
$title_attribute = the_title_attribute( array( 'echo' => false ) );
$image .= '<figure class="post-featured-image">';
$image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
$image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>';
$image .='<span class="arrow"></span>';
$image .= '</figure>';
echo $image;
}
?>
<header class="entry-header">
<?php if (get_the_author() !=''){?>
<div class="entry-meta"> <span class="cat-links">
<?php the_category(', '); ?>
</span><!-- .cat-links -->
</div>
<?php } ?>
<!-- .entry-meta -->
<h2 class="entry-title"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>">
<?php the_title();?>
</a> </h2>
<!-- .entry-title -->
<?php if (has_category() !=''){?>
<div class="entry-meta clearfix">
<div class="by-author vcard author"><span class="fn"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"
title="<?php esc_attr(the_author()); ?>">
<?php the_author(); ?>
</a></span></div>
<div class="date updated"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>">
<?php the_time( get_option( 'date_format' ) ); ?>
</a></div>
<?php if ( comments_open() ) { ?>
<div class="comments">
<?php comments_popup_link( __( 'No Comments', 'interface' ), __( '1 Comment', 'interface' ), __( '% Comments', 'interface' ), '', __( 'Comments Off', 'interface' ) ); ?>
</div>
<?php } ?>
</div>
<!-- .entry-meta -->
</header>
<!-- .entry-header -->
<div class="entry-content clearfix">
<?php the_excerpt(); ?>
</div>
<!-- .entry-content -->
<footer class="entry-meta clearfix"> <span class="tag-links">
<?php $tag_list = get_the_tag_list( '', __( ' ', 'interface' ) );
if(!empty($tag_list)){
echo $tag_list;
}?>
</span><!-- .tag-links -->
<?php
echo '<a class="readmore" href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'.__( 'Read more', 'interface' ).'</a>';
?>
</footer>
<!-- .entry-meta -->
<?php } else { ?>
</header>
<?php the_content();
} ?>
</article>
</section>
<!-- .post -->
<?php
do_action( 'interface_after_post' );
}
}
else {
?>
<h2 class="entry-title">
<?php _e( 'No Posts Found.', 'interface' ); ?>
</h2>
<?php
}
}
endif;
/****************************************************************************************/
Код точно верный? при добавлении перед if( have_posts() ) {
<?php if(is_post_type_archive('task')||is_tax('task-subject')) get_freelance_task_filter(); ?>Он отключает код -
<section id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action( 'interface_before_post_header' ); ?><?php if(is_post_type_archive('task')||is_tax('task-subject')) get_freelance_task_filter(); ?>
<article>Может какая скобка пропущенна? я в PHP не силён
Вы не имеете права на публикацию сообщений в этой теме