hello, I need a step by step help to understand how could make a style for posts and another style for pages in wordpress. I'm new in WP so please you should be the most explicit. thaNk you for your help
If you go to the theme editor in wordpress backend you will see a list of files on the right side look for single.php this is for displaying your blog posts, you can edit the file code to make any changes here you must have atleast some basic knowledge of php to edit this file. To be safe first save all code on this page as backup and then start making changes. To edit the page file look for page.php. If you have access to physical files like local wamp or FTP then you can access these files at wordpress directory/wp-content/themes/your theme name/ If you only want to change styles(css) then you will have to edit the CSS file named as styles.css
Go to your wp-admin>Appearance>editor. Basically you will be editing 2 files. 1.] single.php (this is for posts) 2.] page.php (this is for pages) Just alter the style on the 2 files to your desired style
this is the code i have in page.php: <?php get_header(); ?> <?php get_sidebar(); ?> <!-- start content --> <div id="content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h1 class="title"><?php the_title(); ?></h1> <div class="entry"> <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> </div> <?php endwhile; endif; ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> </div> <!-- end content --> <?php include (TEMPLATEPATH . '/_sidebar2.php'); ?> <?php get_footer(); ?> if i have understood I have to change the css file, and i should create other css code exclusively for the pages but what in the above code i have to replace?
You need to create a new class and replace it in this php code like <h1 class="title"><?php the_title(); ?></h1> <div class="entry"> Class="title" should be replaced with your new class and it becomes <h1 class="page_title"> <div class="entry"> becomes <div class="page_entry">