• Hello friends beasts in WordPress.

    I need a big help.

    My theme has different page templates and would like to adapt each other. For example, this is the template I’m using on every page.

    TEMPLATE 1

    <?php
    /**
     * Template Name: Page with sidebar
    */
    
    get_header('page'); ?>
    <section class="scrollable wrapper-lg">
      <div class="row">
        <div class="col-sm-9">
    
          <?php while ( have_posts() ) : the_post(); ?>
              <div class="panel wrapper-lg">
                <?php get_template_part( 'template-parts/content', 'page' ); ?>
              </div>
              <?php
                  // If comments are open or we have at least one comment, load up the comment template.
                  if ( comments_open() || get_comments_number() ) :
                      comments_template();
                  endif;
              ?>
    
          <?php endwhile; // End of the loop. ?>
    
        </div>
        <div class="col-sm-3">
          <?php get_sidebar('page');  ?>
        </div>
      </div>
    </section>
    <?php get_footer('page');  ?>

    But this template is the page you want to replace some items. For example, I want mater of its contents, however, want to insert some items that exist on the other template.

    TEMPLATE 2

    <?php
    /**
     * Template Name: Genres
    */
    
    get_header(); ?>
    <section class="w-f-md">
        <section class="hbox stretch">
            <aside class="aside bg-light dk">
                <section class="vbox">
                    <section class="scrollable hover">
                        <?php the_widget( 'music_term_widget', 'taxonomy=download_category&display=list&widget=false&hide_empty=on&show_count=on' );?>
                    </section>
                </section>
            </aside>
            <section>
                <section class="vbox">
                    <section class="scrollable padder-lg">
                    	<h1 class="font-thin h2 m-t m-b"><?php esc_html_e('Todas', 'musik'); ?></h1>
                        <?php
                            $count = get_option( 'posts_per_page' );
                            the_widget( 'music_post_widget', 'count='.$count.'&orderby=date&pagination=on' );
                        ?>
                    </section>
                </section>
            </section>
        </section>
    </section>
    <?php get_template_part( 'template-parts/player' ); ?>
    <?php get_footer( );  ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    I will explain using pictures.

    This is the original model template 2:

    https://cetps-pa.com.br/compositor/sample1.jpg

    I want you to be well, based on the model template 1:

    https://cetps-pa.com.br/compositor/sample2.jpg

    Basically just insert the white background and add logal the widget. I did in Photoshop, they are a good designer and not a good programmer

    I hope you help me!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Modifying template PHP?’ is closed to new replies.