How to override html codes in wordpress?

article id="post-?php the_ID(); ?" ?php post_class( array('list-article', 'clearfix') ); ?

div class="list-article-thumb"
    a href="?php echo esc_url( get_permalink() ); ?"
        ?php
        if ( has_post_thumbnail( ) ) {
            the_post_thumbnail( 'onepress-blog-small' );
        } else {
            echo 'img alt="" src="'. get_template_directory_uri() . '/assets/images/placholder2.png' .'"';
        }
        ?
    /a
/div

div class="list-article-content"
    div class="list-article-meta"
        ?php the_category(' / '); ?
    /div
    header class="entry-header"
        ?php the_title( sprintf( 'h2 class="entry-title"a href="%s" rel="bookmark"', esc_url( get_permalink() ) ), '/a/h2' ); ?
    /header!-- .entry-header --
    div class="entry-excerpt"
        ?php
            the_excerpt();
        ?
        ?php
            wp_link_pages( array(
                'before' = 'div class="page-links"' . esc_html__( 'Pages:', 'onepress' ),
                'after'  = '/div',
            ) );
        ?
    /div!-- .entry-content --
/div

this is the code.

I need override all codes inside

div class="list-article-content"
/div

because html codes are not surrounded by if(!functionname()){}

I don't know how to override this code.

I tried to copy and paste into functions.php in child theme but it just duplicated html code.

So, how to override this html code to child theme without editing parent theme?

Topic parent-theme child-theme php html Wordpress

Category Web


I found solution to my question. Just create folder with same name (in my case name is template-parts) and pasted copied php file to the folder.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.