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

本文标签: