The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End php WordPress problem

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #146711

    Hi guys. I know how to deal with html and css, but know nothing about php. I need to add one div in wordpress theme, but there are only php files(if I right understood their generate look of the page). How can I add one div in page. Here is page.php from my theme:

    <?php get_header(); ?>
    <div class="row">
        <header class="page-heading block-background block-inner">
          <h3><?php the_title(); ?></h3>
          <div class="minimize"></div>
        </header><!-- .page-heading -->
        <div class="main-content block-background column col12">
          if(have_posts()) : while(have_posts()): the_post();
          <div class="block-inner">
            <article class="entry-post">
              <div class="entry-content">
                <?php the_content(); ?>
                <?php wp_link_pages(array('before' => __('<p><strong>Pages:</strong>','colabsthemes'), 'after' => '</p>', 'next_or_number' => 'number')); ?>
              </div><!-- .entry-content -->
            <?php comments_template(); ?>
          </div><!-- .block-inner -->
        </div><!-- .main-content -->
    <?php get_footer(); ?>

    I tried to write after header:

    <div class="featire-block"></div>

    but I don’t see it in DevTools. Can somebody explain how to solve this problem. Thanks.


    Yes, that’s basically the way of doing it. However, in your case you would only see that on an actual Page, but note that I mean “page” in the sense of a WordPress Page here — not a website page.

    (A WP page is a static page, created in the PAGE section in the WP admin. See the link above for details).

    If you want your div to show up on every single page in your website, you’d be better off adding the div in HEADER.PHP.


    Thanks. Start extensively read Do you think it will help?

    For instance, if you want to change the PHP code for the site header, you can include a header.php in your child theme’s directory, and that file will be used instead of the parent theme’s header.php.


    Uh, reading will help, yes. But no idea why you start to include information about child themes all of a sudden.


    Thanks guys, I solved the problem. I made custom template and in a page settings changed page attributes on my custom page.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.