Gå til innhold

Eget WP-theme - trenger hjelp sider [LØST]


Anbefalte innlegg

Hei!

 

Jeg driver å lager et eget theme for WP som jeg kanskje skal bruke på sida mi, men først må jeg jo lage et theme og det er så og si ferdig nå.

 

Men jeg fant akkurat ut når jeg legger til "Pages" så kan man kommentere de sidene :s

Hvordan får jeg bort det?

 

Legger med litt kode jeg.

 

 

comments.php

Klikk for å se/fjerne innholdet nedenfor
<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
 die ('Please do not load this page directly. Thanks!');

if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn’t match the cookie
   ?>

   <p class="nocomments">This post is password protected. Enter the password to view comments.<p>

   <?php
   return;
}
}

 /* This variable is for alternating comment background */
 $oddcomment = 'alt';
?>

<div id="comments">

<?php if ($comments) : ?>
<div class="comments_list">

<ol>
<?php foreach ($comments as $comment) : ?>

<li class="comment" id="comment-<?php comment_ID() ?>">

  <div class="comments_author">
   <?php comment_author_link() ?>
  </div>
  <div class="comments_text">

<?php if ($comment->comment_approved == '0') : ?>
 <em>Your comment is awaiting moderation.</em>
<?php endif; ?>
<?php comment_text() ?>

  </div>

</li>


<li><br /></li>

<?php /* Changes every other comment to a different class */
 if ('alt' == $oddcomment) $oddcomment = ”;
 else $oddcomment = 'alt';
?>

<?php endforeach; ?>
</ol>

</div> <!-- close comments_list -->

<?php else : // this is displayed if there are no comments so far ?>

<?php if ('open' == $post->comment_status) : ?>
 <!-- If comments are open, but there are no comments. -->

 <?php else : // comments are closed ?>
 <!-- If comments are closed. -->
 <p class="nocomments">Comments are closed.</p>

<?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
<?php else : ?>

<div class="comments_form">



<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>

<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p>

<?php else : ?>

<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label></p>

<?php endif; ?>

<p><textarea name="comment" id="comment" cols="50" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<div class="comment_meta">
<?php if ($post-> comment_status == "open" && $post->ping_status == "open") { ?>
 <p>
  <a href="<?php trackback_url(display); ?>">Trackback this post</a>  |  <?php comments_rss_link('Subscribe to the comments via RSS Feed'); ?>
 </p>

<?php } elseif ($post-> comment_status == "open") {?>
 <p>
  <?php comments_rss_link('Subscribe to the comments via RSS Feed'); ?>
 </p>
<?php } elseif ($post->ping_status == "open") {?>
 <p>
  <a href="<?php trackback_url(display); ?>">Trackback this post</a>
 </p>
<?php } ?>
</div>
<?php endif; // If registration required and not logged in ?>

</div> 

<?php endif; // if you delete this the sky will fall on your head ?>

</div>

footer.php

Klikk for å se/fjerne innholdet nedenfor
</div>
<!-- close content -->

<div id="footer">
Copyright © <a href="http://www.cms.andersmoen.com/wordpress/" class="copy"><?php bloginfo('name'); ?></a>
<br />

</div>


</div>

<img src="http://andersmoen.com/images2/footer.jpg" alt="" />
</div>
</div>

<?php wp_footer(); ?>

</body>
</html>

header.php

Klikk for å se/fjerne innholdet nedenfor
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />

<title><?php bloginfo('name'); ?> <?php if ( is_single() 

) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>


<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'); ?>" />
<link 

rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<style type="text/css" media="screen">

<?php
// Checks to see whether it needs a sidebar or not
if ( !$withcomments && !is_single() ) {
?>
#page { 

background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg.jpg") repeat-y top; border: none; }
<?php } else { // No sidebar ?>
#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
<?php } ?>

</style>

<?php wp_head(); ?>
</head>
<body>

<div id="wrapper_bg">
<img src="http://andersmoen.com/images2/logo.jpg" alt="<?php bloginfo('name'); ?>" />
<div id="wrapper1">
<div id="wrapper2">

<div id="page">

index.php

Klikk for å se/fjerne innholdet nedenfor

<?php get_header(); ?>



<div id="menu">
<?php get_sidebar(); ?>
</div>

<div id="main">
<div class="in">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>


<div class="post_title">
<a href="<?php the_permalink() ?>" class="title" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
</div>


<div class="post_content">
<?php the_content(__('Read more…')); ?>
</div>


<div class="post_tag">
<?php the_time('F dS, Y') ?> | <?php the_time('h:i a'); ?> | <?php the_category(', '); ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> | <?php edit_post_link('Edit','',''); ?>
<br />
<br />
<br />
</div>


<?php comments_template(); ?>
<?php endwhile; else: ?>
Sorry, but you are looking for something that isn't here.
<?php endif; ?>

</div>
</div>

<div class="both"> </div>



<?php get_footer(); ?>

sidebar.php

Klikk for å se/fjerne innholdet nedenfor


<span class="blog_title">Pages</span>
<ul class="menu">
<li><a href="http://cms.andersmoen.com/wordpress/">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&title_li='); ?>
</ul>

<br />

<span class="blog_title">Archives</span>
<ul class="menu">
<?php wp_get_archives('type=monthly'); ?>
</ul>

<br />

<span class="blog_title">Categories</span>
<ul class="menu">
<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
</ul>

style.css

Klikk for å se/fjerne innholdet nedenfor
body {
color: #000;
font-size: 10pt;
font-family: Tahoma, Arial;
background-color: #5277a3;
}

#wrapper {
width: 800px;
background: #FFF url(http://andersmoen.com/images2/bg_top.jpg) no-repeat top;
margin: 0 auto;
}

#wrapper_bg {
width: 800px;
margin: 0 auto;
background: #FFF url(http://andersmoen.com/images2/bg.jpg) repeat-y top;
}

#wrapper1 {
width: 800px;
margin: 0 auto;
}

#wrapper2 {
padding: 20px;
}


#footer {
width: 100%;
text-align: center;
font-size: 8pt;
line-height: 11pt;
}

#menu {
width: 140px;
float: left;
}

#main {
width: 470px;
float: left;
}


.both {
width: 100%;
clear: both;
}

h1 {
color: #7793e3;
font-size: 20pt;
font-family: 'Trebuchet MS', Georgia, Tahoma, Arial;
}

h2 {
padding: 0px;
margin: 0px;
padding-top: 15px;
}

img {
border: 0px;
}

ul {
padding: 0px;
margin: 0px;
}

img.smiley {
vertical-align: middle;
}

li {
list-style-type: none;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 17px;
padding-right: 17px;
}

.comment {
color: #555;
font-size: 9pt;
font-family: Tahoma, Arial;
background: #CCC;
}

a.menu:link, a.menu:active, a.menu:visited {
color: #000;
font-size: 11pt;
font-family: Tahoma, Arial;
background-color: #FFF;
text-decoration: none;
}

a.menu:hover {
color: #009cff;
font-size: 11pt;
font-family: Tahoma, Arial;
background-color: #FFF;
text-decoration: none;
}

a.menus:link, a.menus:active, a.menus:visited {
color: #009cff;
font-size: 11pt;
font-family: Tahoma, Arial;
background-color: #FFF;
text-decoration: none;
}

a.menus:hover {
color: #009cff;
font-size: 11pt;
font-family: Tahoma, Arial;
background-color: #FFF;
text-decoration: none;
}

a:link, a:active, a:visited {
color: #555;
font-size: 10pt;
font-family: Tahoma, Arial;
text-decoration: underline;
}

a:hover {
color: #FF6600;
font-size: 10pt;
font-family: Tahoma, Arial;
text-decoration: underline;
}

a.copy:link, a.copy:active, a.copy:visited {
color: black;
font-size: 8pt;
font-family: Tahoma, Arial;
background-color: #FFF;
text-decoration: underline;
}

a.copy:hover {
color: black;
font-size: 8pt;
font-family: Tahoma, Arial;
background-color: #FFF;
text-decoration: none;
}

span.content {
color: #555;
line-height: 16pt;
}

.portfolio1 {
width: 100%;
border: 1px solid #999;
background: #FFF url(http://andersmoen.com/images2/bg_ho.jpg) no-repeat top right;
}

.portfolio2 {
padding: 10px;
}

.portfolio_title {
color: #3b4773;
font-size: 14pt;
font-family: 'Trebuchet MS', Georgia, Tahoma, Arial;
line-height: 22pt;
}

p {
color: #333;
font-size: 10pt;
font-family: Tahoma, Arial;
line-height: 14pt;
}

.screenshot {
width: 400px;
}

img.gallery {
width: 150px;
height: 70px;
padding: 3px;
}

.gallery {
width: 153px;
float: left;
padding-bottom: 5px;
}

.blog_title {
font-size: 18pt;
line-height: 24pt;
font-family: 'Trebuchet MS', Georgia;
}

.quote {
font-size: 8pt;
background-color: #a2c7ed;
width: 100%;
}

.in {
padding: 5px;
}

img.icon {
vertical-align: middle;
}

a.title:link, a.title:active, a.title:visited {
color: #497ddc;
font-size: 14pt;
line-height: 17pt;
text-decoration: none;
}

a.title:hover {
color: #FF6600;
font-size: 14pt;
line-height: 17pt;
text-decoration: none;
}

a.no_under:link, a.no_under:active, a.no_under:visited, a.no_under:hover {
text-decoration: none;
}

a.small:link, a.small:active, a.small:visited {
font-size: 8pt;
}

small {
font-size: 8pt;
line-height: 11pt;
}

small.date {
color: #999;
font-size: 7pt;
line-height: 10pt;
}

span.right {
font-size: 14pt;
}



















.bold {
  font-weight: bold;
}

.italics {
  font-style: italic;
}

.underline {
  text-decoration: underline;
}

.strikethrough {
  text-decoration: line-through;
}

.overline {
  text-decoration: overline;
}

.sized {

}

.quotecodeheader {
  font-family: Verdana, arial, helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
}

.codebody {
  background-color: #FFFFFF;
   font-family: Courier new, courier, mono;
   font-size: 9pt;
   color: #006600;
   border: 1px solid #BFBFBF;
   line-height: 12pt;
}

.code {
padding: 5px;
}

.quotebody {
  background-color: #FFFFFF;
   font-family: Courier new, courier, mono;
   font-size: 12px;
   color: #660002;
  border: 1px solid #BFBFBF;
}

.listbullet {
  list-style-type: disc;
  list-style-position: inside;
}

.listdecimal {
  list-style-type: decimal;
  list-style-position: inside;
}

.listlowerroman {
  list-style-type: lower-roman;
  list-style-position: inside;
}

.listupperroman {
  list-style-type: upper-roman;
  list-style-position: inside;
}

.listloweralpha {
  list-style-type: lower-alpha;
  list-style-position: inside;
}

.listupperalpha {
  list-style-type: upper-alpha;
  list-style-position: inside;
}









#forum {
width: 100%;
}

#forum_menu {
width: 100%;
text-align: center;
}

.form_hidden {
visibility: hidden;
}

.forum_left {
width: 20%;
float: left;
}

.forum_right {
width: 80%;
float: left;
}




.about {
width: 80px;
font-weight: bold;
}

 

CSS'en var kanskje ikke nødvendig?

 

 

Håper noen kan hjelpe :)

 

 

 

Btw: jeg fulgte denne tutorialen for å gjøre dette...

Endret av Anders-Moen
Lenke til kommentar
Videoannonse
Annonse

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...