Pages settings
-
Hello. Sorry for my english, I will try to explain: When I visit my website, I see all my posts from all categories. I want to have only specific posts from category “A” to be on the home page. I want to have the posts from category “B” on a parent page. (Example)When you click the link of the parent page it sort the posts from the category “B” only. Well in wordpress’s options I’ve found out that in “Read”(or something else in english) I can choose static page for the home page and choose a different page for the posts. The problem is that I can’t make it to work like I want. Someone can help me please? Thanks!
I think that it’s in the header.php that I have to put the right code to do what I want to do.
Here is my header.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml"> <head profile="https://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" /> <?php if (is_single()) { ?> <title><?php the_title(); ?> | <?php bloginfo('name'); ?></title> <?php } else { ?> <title><?php bloginfo('name'); ?> | <?php bloginfo('description'); ?></title> <?php } ?> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <?php include_once("colors.php"); ?> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?> </head> <body> <div id="header_nav"> <ul id="nav" class="clearfloat"> <li><a href="<?php echo get_option('home'); ?>/" class="on">Accueil</a></li> <?php wp_list_pages('title_li='); ?> </ul> </div> <div id="header_left"> <div class="blogtitle"> <a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a> </div> <div class="blogdescription"> <?php bloginfo('description'); ?> </div> </div>
And here is a header.php that does a little what I want:
<?php /** * @package WordPress * @subpackage Motion */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="https://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php if (is_home () ) { bloginfo('name'); echo " - "; bloginfo('description'); } elseif (is_category() ) {single_cat_title(); echo " - "; bloginfo('name'); } elseif (is_single() || is_page() ) {single_post_title(); echo " - "; bloginfo('name'); } elseif (is_search() ) {bloginfo('name'); echo " search results: "; echo wp_specialchars($s); } else { wp_title('',true); }?></title> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/images/favicon.ico" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <!-- for translations --> <?php if (strtoupper(get_locale()) == 'HE_IL' || strtoupper(get_locale()) == 'FA_IR') : ?> <link href="<?php bloginfo('stylesheet_directory'); ?>/rtl.css" rel="stylesheet" type="text/css" media="screen" /> <?php endif; ?> <!--[if lt IE 7]> <link href="<?php bloginfo('template_url'); ?>/ie6.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/unitpngfix.js"></script> <![endif]--> <!--[if IE 7]> <link href="<?php bloginfo('template_url'); ?>/ie7.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <script type="text/javascript"><!--//--><![CDATA[//><!-- sfHover = function() { if (!document.getElementsByTagName) return false; var sfEls = document.getElementById("nav").getElementsByTagName("li"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); //--><!]]></script> <?php wp_head(); ?> </head> <body> <div id="wrapper"> <div id="top"> <div id="topmenu"> <ul> <?php wp_list_pages('depth=1&title_li=0&sort_column=menu_order'); ?> <li><a class="rss" href="<?php bloginfo('rss2_url'); ?>">rss</a></li> </ul> </div><!-- /topmenu --> <div id="search"> <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/"> <p> <input type="text" value="Rechercher Sur Le Site" onfocus="if (this.value == 'Search this site') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this site...';}" name="s" id="searchbox" /> <input type="submit" class="submitbutton" value="GO" /> </p> </form> </div><!-- /search --> <div class="cleared"></div> </div><!-- /top --> <div id="header"> <div id="logo"> <a href="<?php echo get_option('home'); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/genericlogo.png" alt="<?php bloginfo('name'); ?>" /></a> <h1><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1> <div id="desc"><?php bloginfo('description'); ?></div> </div><!-- /logo --> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('header') ) : ?> <div id="headerbanner"> <p>Ici-même se trouve quelques unes de mes créations artistiques de toute sorte. Alors amusez-vous à les regarder comme j'ai aimé les produire.</p> </div><!-- /headerbanner --> <?php endif; ?> <div class="cleared"></div> </div><!-- /header --> <div id="catnav"> <ul id="nav"> <li><a href="<?php echo get_option('home'); ?>">Accueil</a></li> <?php wp_list_categories('orderby=name&title_li=&depth=2'); ?> </ul><!-- /nav --> <div class="cleared"></div> </div> <!-- /catnav -->
- The topic ‘Pages settings’ is closed to new replies.