peterwongpp
Forum Replies Created
-
You could modify a theme to delete those
comment_template()
calls which are used to load the comment form.No archives, no categories just do not use those widgets, and only write pages instead of posts.
Forum: Themes and Templates
In reply to: title for category links in a while loop to appear once<?php $i=0; <?php while (have_posts()) : the_post(); ?> <?php if($i == 0) { $i++; ?> <!-- title table or add checking if this is "BOOKS" --> <?php } else { ?> <!-- Original content inside the loop -- > <?php } ?> ......
As $i is incremented by
$i++
, the part for output the title table will only be executed once.
If you need checking if the category is BOOKS or not so that the title table will appear only in BOOKS, do checking after the$i++
Hope that helps you
Forum: Themes and Templates
In reply to: title for category links in a while loop to appear onceput the while loop outside the foreach and add a counter to keep track the first loop.
ie. $i = 0; outside the while loop
inside the while loop, check if $i == 0, then output the title and increment $i.since the looping involve not so many steps, the overhead won’t too large
Forum: Themes and Templates
In reply to: How to Change ‘reply’ text link to other text?could you find something like mytheme_comment function in functions.php?
or simply search through functions.php and comments.php for function call “comment_reply_link”, which creates the Reply link.
You could read more on here: https://codex.www.ads-software.com/Template_Tags/comment_reply_link
Forum: Plugins
In reply to: How to submit plugin?Thanks
Forum: Plugins
In reply to: How to submit plugin?So you mean send email to [email protected] to ask the status?
Forum: Themes and Templates
In reply to: How do I link a CSS file to my page?So is it onebar.css and twobar.css both contain theme declarations (some formatted description in the top onside the css)?
Forum: Themes and Templates
In reply to: how to include searchform.php<?php else: include(TEMPLATEPATH . '/searchform.php'); ?>
is this ok?
Forum: Themes and Templates
In reply to: separating post text from imagesI’ve an idea.
create a the_content filter in like functions.php so that when you call the_content() in template, you can “re-format” the content.
Inside the filter function, just use regular expression to extract all images out, put those extracted images into a div and put all remained texts into another div.
Sorry that I’m using mobile and finding & copying codes are not convenient.
Forum: Themes and Templates
In reply to: howto show category name by IDThis might help you: get_category
get_category return an object as default.
Forum: Themes and Templates
In reply to: Align left entried postIn fact, I can see the posts are aligned left already.
Maybe it is a browser problem? Which browser are you using?
Forum: Themes and Templates
In reply to: Adding author not working….Please change to
echo '<span class="postdate serif">'.date("F j, Y",strtotime($row['post_date'])).'by '; the_author_posts_link(); echo '</span>';
and try again.
Forum: Themes and Templates
In reply to: Built-in gallery and XHTML validationThanks very much! I’ve installed the plugin you mentioned and everything is right now^^
Forum: Themes and Templates
In reply to: Random categoryuse get_categories to get an array of categories may solve the problem.
You could take a look on this page: get_categories<?php $cats = get_categories(/* input params as you like */); $randomCate = $cats[rand(0, count($cats)-1)]; ?>
you may try print_r($randomCate) to see the structure of it, which is also an array.
Forum: Themes and Templates
In reply to: Post Body Background/CSS Controlled Via Admin?Is the image only apply to a single post? (as for other case like category page, there is a number of posts that may have different images)
If in this case (only for a single post), I suggest to add something like the followings into the single.php inside the loop:
<?php $imageName = get_post_meta($post->ID, "CustomFieldNameForTheImage", true); if($imageName != '') { ?> <style type="text/css"> body { background-image:url(<?php bloginfo('template_directory'); ?>/uploads/<?php echo $imageName ?>.jpg);background-repeat:repeat;); } <?php } ?>
The problem is that style tag inside body will cause validating error.