admin管理员组文章数量:1125902
I have a page and attachment addes to this page. Now I can output the content of this page with modified link attachment, when each attachment link otput title size and type of attachment like this
<a href="name of file">Name attachment ( 456kB, *.pdf)</a>
I want todo this without plugin. Attachment I add in backend edit page with upload file. No use plugin. On frontend I use child Underscore + Understrap child theme. And I use classic editor in backend. No builder using.
<?php
/**
* Partial template for content in page.php
*
* @package Understrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php
if ( ! is_page_template( 'page-templates/no-title.php' ) ) {
the_title(
'<header class="entry-header"><h1 class="entry-title">',
'</h1></header><!-- .entry-header -->'
);
}
echo get_the_post_thumbnail( $post->ID, 'large' );
?>
<div class="entry-content">
<?php
the_content();
understrap_link_pages();
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php understrap_edit_post_link(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-<?php the_ID(); ?> -->
I try to do it by add filter in wp_get_attachment_links do not modify output for attachment links but this is not good way
本文标签:
版权声明:本文标题:How to insert information about the size and type of an attachment into page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736602022a1945237.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论