- This topic is empty.
-
AuthorPosts
-
August 13, 2013 at 9:42 am #146711KuzyoParticipant
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"> <?php 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 --> </article> <?php comments_template(); ?> </div><!-- .block-inner --> <?php endwhile; endif; ?> </div><!-- .main-content --> </div> <?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.
August 13, 2013 at 11:12 am #146719SenffParticipantYes, 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.
August 14, 2013 at 2:29 am #146762KuzyoParticipantThanks. Start extensively read wordpress.org. 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.
August 14, 2013 at 10:05 am #146818SenffParticipantUh, reading wordpress.org will help, yes. But no idea why you start to include information about child themes all of a sudden.
August 14, 2013 at 1:06 pm #146835KuzyoParticipantThanks guys, I solved the problem. I made custom template and in a page settings changed page attributes on my custom page.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.