как добавить & lt; hr & gt; на WordPress блоги просматривать раздел

Привет, ребята, я новичок в разработке WP, это мой клиентский сайт: bit.do/dFQtv мне нужно добавить hr строка под каждым отрывком из блога ниже, раздел «читать дальше», как это сделать, если я вставлю строку «кнопка« Читать далее »», которая также отображается на одной странице блога.

это кодирование: (template-parts / content.php)

 <?php
/**
* Template part for displaying posts
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
*
*/

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '"  rel="bookmark" >', '</a></h2>' );
endif;

if ( 'post' === get_post_type() ) :  ?>
<h4 class="meta text-muted">
<?php blog_posted_on(); ?>
</h4><!-- .entry-meta -->
<?php
endif; ?>

<!-- AddThis Button BEGIN -->
<div class="addthis_inline_share_toolbox_mzc3" style="margin-bottom:20px;" data-title="<?php the_title() ?>" data-url="<?php the_permalink(); ?>" </div>
<!-- AddThis Button END -->

</header><!-- .entry-header -->

<div class="entry-content"><?php
the_content( sprintf (
/* translators: %s: Name of current post. */
wp_kses(__( 'Read more', 'blog' ), array( 'span' => array( 'class' =>
array() ) ) ),

the_title( '<span class="screen-reader-text">"', '"</span>', false )
) );wp_link_pages( array(
'before' => '<div class= "page-links">'. esc_html__('Pages:', 'blog'
),

'after'  => '</div>',
) );
?>

</div><!-- .entry-content -->

<footer class="entry-footer">
<?php blog_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

(Шаблон-части / содержание-page.php)

<?php
/**
* Template part for displaying page content in page.php
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
*
*/

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->

<div class="entry-content"><hr>
<?php
the_content();wp_link_pages(array(
'before' => '<div class="page-links">' . esc_html__('Pages:','blog'),
'after'  => '</div>',
) );
?>
</div><!-- .entry-content --><?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
esc_html__( 'Edit %s', 'blog' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
),
'<span class="edit-link">',
'</span>'
);
?>
<hr>
</footer><!-- .entry-footer -->
<?php endif; ?>
</article><!-- #post-## -->

0

Решение

В соответствии с вашей темой вы добавляете <hr> пометить последнюю строку в вашем content.php внутри template-partsпапка.
как это:

<footer class="entry-footer">
<?php bfablog_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-<?php the_ID(); ?> --><hr>

Дважды проверьте, что вы редактируете правильный файл … Я пытался, и он работает

0

Другие решения

Просто добавьте тег hr после закрытия тега article, а также вы можете написать CSS для его изменения ширины и цвета.

<?php
/**
* Template part for displaying page content in page.php
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
*
*/

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->

<div class="entry-content"><hr>
<?php
the_content();wp_link_pages(array(
'before' => '<div class="page-links">' . esc_html__('Pages:','bfablog'),
'after'  => '</div>',
) );
?>
</div><!-- .entry-content --><?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
esc_html__( 'Edit %s', 'bfablog' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
),
'<span class="edit-link">',
'</span>'
);
?>
<hr>
</footer><!-- .entry-footer -->
<?php endif; ?>
</article><!-- #post-## -->
<hr class="abc" />
0

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector