shatterjack
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: “comments are closed” when they should be open!is there anything i need to be aware of since I am calling my posts and comments from the database with sql queries and don’t have a typical loop?
Forum: Fixing WordPress
In reply to: Comments box not showing up on new posts — why?hey alism, any chance you might have an idea about why my comment field isn’t showing up? as soon as I add the $withcomments=1 and comment_tempalte() I get “comments are closed” after each post. The comments themselves are outputting, but not the entry fields.
<?php 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 ?> <h2><?php _e('Password Protected'); ?></h2> <p><?php _e('Enter the password to view comments.'); ?></p> <?php return; } } $oddcomment = 'alt'; ?> <?php if ($comments) : ?> <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3> <ol class="commentlist"> <?php foreach ($comments as $comment) : ?> <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> <div class="commentmetadata"> <strong><?php comment_author_link() ?></strong>, <?php _e('on'); ?> <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> <?php _e('at');?> <?php comment_time() ?></a> <?php _e('Said:'); ?> <?php edit_comment_link('Edit Comment','',''); ?> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.'); ?></em> <?php endif; ?> </div> <?php comment_text() ?> </li> <?php /* Changes every other comment to a different class */ if ('alt' == $oddcomment) $oddcomment = ''; else $oddcomment = 'alt'; ?> <?php endforeach; ?> </ol> <?php else : ?> <?php if ('open' == $post->comment_status) : ?> <!-- If comments are open, but there are no comments. --> <?php else : // comments are closed ?> <p class="nocomments">Comments are closed.</p> <?php endif; ?> <?php endif; ?> <?php if ('open' == $post->comment_status) : ?> <h3 id="respond">Leave a Reply</h3> <?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 : ?> <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="40" 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="40" 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="40" tabindex="3" /> <label for="url"><small>Website</small></label></p> <?php endif; ?> <!--<p><small><strong>XHTML:</strong> <?php _e('You can use these tags:'); ?> <?php echo allowed_tags(); ?></small></p>--> <p><textarea name="comment" id="comment" cols="60" 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> <?php endif; ?> <?php endif; ?>
sorry about the length but I was having a hard time with the paste bin for some reason…
Forum: Fixing WordPress
In reply to: comment field and some comments not appearing in custom themehaha oops wow I’ve never made my whole post into a link before ?? I guess that calls my code into suspicion…
Forum: Fixing WordPress
In reply to: problem: multiple versions of posts displaying (all edited versions)I got it, I didn’t know there were different categories of posts – “post” for the most recent version of a post, “revision” for intermediate edits, “page” for any pages you make, and “attachment” for any files like the header image etc. You just filter with
WHERE post_type=’post’;Forum: Fixing WordPress
In reply to: get latest post idesmi, is there a way to do this for each author and then sort the authors by their latest post?
Forum: Everything else WordPress
In reply to: Use get_the_id() with an Array?michael,
If I’m trying to make an array to find the author who has had posted the most recent post, would I do something like above where I use functions inside an array? I want to sort the authors by most recent post and assign the authors to divs based on that order.
Forum: Fixing WordPress
In reply to: Order author divs from left to right by most recent postMaybe I can output data about the authors to an array which sorts it? Does anyone have an idea about how to do that?
Forum: Fixing WordPress
In reply to: Is Kubrick the best theme to do this with?thanks esmi you posted that link on my other post. I read the multiple loop section and copied some of the code into my own. I’m still having trouble getting it to output two columns on my page, one for each category. Among other things, I was wondering if I should use Kubrick or another template instead. Thanks
Forum: Themes and Templates
In reply to: Create two divs in content area and assign each a categoryis the code I inserted screwing something up? Should I move it to a different place in the file? Is there a particular place in my css file to define this part:
#left,#right {
width:50%;
float:left;
}?
please help or point me to something…Forum: Themes and Templates
In reply to: Create two divs in content area and assign each a categoryany ideas?
Forum: Themes and Templates
In reply to: Create two divs in content area and assign each a categoryShoot I still need some help. I’m using the index.php from Kubrick. I keep getting this error:
Parse error: syntax error, unexpected T_ELSE in /home1/hippievs/public_html/wp-content/themes/default/index.php on line 60
Here is my main index:
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/get_header(); ?>
<div id=”content” class=”narrowcolumn” role=”main”>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
<h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
<small><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small><div class=”entry”>
<?php the_content(‘Read the rest of this entry »’); ?>
</div><p class=”postmetadata”><?php the_tags(‘Tags: ‘, ‘, ‘, ‘
‘); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
</div><?php endwhile; ?>
<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(‘« Older Entries’) ?></div>
<div class=”alignright”><?php previous_posts_link(‘Newer Entries »’) ?></div>
</div>/*inserted new stuff here
*/<div id=”left”>
<?php $my_query = new WP_Query(‘category_name=tony&showposts=3’);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>
<?php endwhile; ?>
</div><div id=”right”>
<?php $my_query = new WP_Query(‘category_name=hippie&showposts=3’);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>
<?php endwhile; endif; ?>
</div>/*end of insertion*/
<?php else : ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php get_search_form(); ?><?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
———————
———————Any ideas? I’m not sure what’s going on. Also I put the
#left,#right {
width:50%;
float:left;
}in the structure portion of my style.css file. Does it matter where it goes in that list? Thanks a lot anyone!
tony
hippievstony.com
Forum: Themes and Templates
In reply to: Create two divs in content area and assign each a categoryForum: Themes and Templates
In reply to: Create two divs in content area and assign each a categorywould i place the div tag like this? I changed the second section to list posts with the “hippie” category rather than the leftovers after the call for “tony” posts. thanks esmi!
<div id=”left”>
<?php $my_query = new WP_Query(‘category_name=tony&showposts=3’);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>
<!– Do stuff… –>
<?php endwhile; ?>
</div><div id=”right”>
<?php $my_query = new WP_Query(‘category_name=hippie&showposts=3’);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>
<!– Do stuff… –>
<?php endwhile; endif; ?>
</div>Forum: Themes and Templates
In reply to: Create two divs in content area and assign each a categorythanks esmi,
I read the article. I copied some code from there, could you tell me if I am going in the right direction? This seems to place all posts with the category “tony” in a list and then everything else goes into another list. Could I place the two lists side by side then? Thanks!
<?php $my_query = new WP_Query(‘category_name=tony&showposts=3’);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>
<!– Do stuff… –>
<?php endwhile; ?>
<!– Do other stuff… –>
<?php if (have_posts()) : while (have_posts()) : the_post();
if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
<!– Do stuff… –>
<?php endwhile; endif; ?>Forum: Themes and Templates
In reply to: Divide Content Area into Two Divs, Assign Each a Tagthanks esmi,
I finally got my blog hosted by bluehost and got wordpress setup on there. Could you explain what I should edit in index.php and archive.php?
Just to sort the posts into two columns for hippie and for tony. If you know a website that is using this function, I could check that out too. thanks!
tony