jfriesen
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to show all posts in a category page?http://codex.wordpress.org/Template_Tags/query_posts
Place something like this before your loop:
<?php query_posts('category_name=Cat Name&showposts=999'); ?>Hope that helps!
Forum: Installing WordPress
In reply to: Archives of months and cathegories doesn’t show all postsForum: Fixing WordPress
In reply to: Slash added at end of linksI think this must be a difference in server configuration. On a brand new site hosted by the same company, I cannot replicate the problem. The site in question was setup more than 5 years ago, so I wouldn’t be surprised if there are differences between the sites’ configurations.
I’m close to resolving the problem using mod_rewrite:
Options +SymlinksIfOwnerMatch
<IfModule mod_rewrite.c>
RewriteEngine On
ReWriteCond %{DOCUMENT_ROOT}$1 -d
RewriteRule ^index.php(/?)$ $1/index.php [L,R=301,NS]
</IfModule>This successfully changes calls to index.php/ to index.php. Great! What it also does however is adds an extra slash after the domain name: mysite.com//index.php.
So far, that hasn’t caused any errors, but it looks a little messy.
There is another problem though: calls to mysite.com/index.php generate a looping error.
Can anyone suggest a better RewriteRule that will avoid these 2 problems?
Thanks!
Forum: Fixing WordPress
In reply to: How to Make Posts Appear Later?Under the Wite Post > Advanced Editing, I believe you can edit the time and date of the post. Posts with time/date in the future won’t display until then. I’m doing this on a WP site, but I can’t remember if you need to use the eventcalendar2 plugin or not. Try it out without the plugin and if it doesn’t work, have a look at http://blog.firetree.net/2005/05/27/eventcalandar23/
Hope that helps!
Forum: Fixing WordPress
In reply to: Slash added at end of linksHmm, I need a litle help with this too.
In the past, I’ve appended “index.php” to Options > Site URL while developing a blog site. This allowed me to work within the root directory of the site despite the presence of an index.htm file in there. Once the site was finished, I’d simply remove “index.php” from the site URL and delete the old index.htm file that was kicking around.
That’s worked just fine for me until now. I am setting up a new WP site on a server where an existing .htm based website lives. So, I append “index.php” to the site URL under Options–this should ensure that all links will work despite the presense of that index.htm file. Lo and behold, this setup is not working on this site. WordPress appends a trailing slash to the site preview URL (mysite.com/index.php/) and the web server tries to serve up the contents of a folder named /index.php/–which of course doesn’t exist–throwing up 500 errors.
Is this due to a difference in how this server is configured?
I have nothing configured for permalinks.
Can anyone tell me how I can work on this site even with that index.htm file in there? How can I append index.php to the site URL but make the server behave as expected?
(Note: Moving the site to a development folder is NOT an option. The site uses the mudbomb WYSIWYG editor and you can’t use that in a dev location because you’ll then need to manually update all the links in your content once you move the site to the production location. See: http://wordpress.org/support/topic/36536)
Thanks!
Sweet! Problem solved. It was a clash with a plugin. I deactivated plugins one by one, and presto, the hacks did their magic. I hope this thread helps someone.
JF 😉By the way, I am willing pay via PayPal for support to get this resolved, or if the person prefers, send a donation to WP.
JF 😉After two days of searching, I would happily use a plugin to get this functionality that I need working. Alas, I’ve tried out 2 (“other posts from cat” and CHAITGEAR’s “SameCat”), and I can’t get either of them to generate any output.
I’ve surfed through hundreds of related posts, all with a myriad of potential solutions, but I can’t get any of them to work. This one I found looks the most promising, and apparently people are using this successfully:
http://wordpress.org/support/topic/50315
I’m not a total PHP nerd, but I can hack around with code. I’m either doing something wrong, or my requirements and/or templates are different. Here is my single.php template:
<?php get_header(); ?><div id="nav_row">
<div id="photo_large">
<!--photo large here-->
</div><?php include("nav.php"); ?>
<div id="photo_small">
<!--photo small here-->
</div></div>
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?><div class="post" id="post-<?php the_ID(); ?>">
<h2>
<?php the_title(); ?>
</h2>
<div class="entrytext">
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
<p class="postmetadata">
<small>
<?php edit_post_link('Edit','',''); ?>
</small>
</p>
</div></div>
<?php endwhile; ?>
<?php else : ?><h2>Not Found</h2>
<p>Sorry, there was a problem finding the content you requested. Please try
again.</p><?php endif; ?>
<?php //Generate section index
if ( is_single('34') || is_single('33') || is_single('32') || is_single('31') || is_single('30') || is_single('28') ) {
$cat = get_the_category();
$cat = $cat[0];
$posts = get_posts("category=" . $cat->cat_ID . "&numberposts=999");
if( $posts ) :
?>
<div class="recent-posts">
<h2>More on this category</h2>
<ul>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<li><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; } ?><?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>Note the section near the end, titled with the comment “Generate section index”–this is the code I need to get working. I simply want to generate a list of links there to all the other posts in the same category as the single post being viewed.
This code is sniffing out the category correctly. If I add in:
$cat = get_the_category();
$cat = $cat[0];
echo $cat->cat_IDthe number “7” is printed to the page–the correct category. The problems start with the next section of code:
$posts = get_posts("category=" . $cat->cat_ID . "&numberposts=999");
if( $posts ) :
?>
<div class="recent-posts">
<h2>More on this category</h2>
<ul>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>Nothing is displayed.
Is there some problem with get_posts working on a single.php (post) template?
Is there some issue here because the Loop is already closed? Do I need to rewind_posts() or use wp_query?
Can anyone offer any guidance?
TIA!
JF 😉Thanks for your reply, moshu!
You’d think a plugin would help wouldn’t you? I hadn’t seen that one you pointed out. It’s pretty cool. However, I don’t really like the implementation: I have to add a quicktag to every post where I want this to appear. I was hoping to simply add code to the single.php template, that way, I don’t have to instruct anyone on how to generate that list in the future–it will be done automatically.
I tried using the main ddop_show_posts() function from that plugin on it’s own in the template, but it doesn’t display anything.
All comments appreciated!
JF 😉Forum: Installing WordPress
In reply to: Any Security Issues in 1.5.2?You will probably want to upgrade to 1.5.3-beta1, an unofficial security release: http://wordpress.org/support/topic/66824
JF 😉Forum: Fixing WordPress
In reply to: alphabetical archivesProblem solved! Thanks again to Kafkaesqui: it was an older post of yours that I just found that did the trick:
http://wordpress.org/support/topic/29255I copied the function code to my-hacks.php, and renamed the function to get_alpha_archives. I called the function just as you would with get_archives:
http://codex.wordpress.org/Template_Tags/get_archivesand it worked!!
Thanks again!
JF 😉Forum: Fixing WordPress
In reply to: alphabetical archivesThank you for your replies!
I tried your code, Kafkaesqui, but it returned a list of PAGES rather than posts. I suspect this is because a page is making the query.
Similarly, I don’t think WP-snap will work because while it alphebetizes categories, it appears to do it category at a time–I don’t see any way to configure it that would display ALL posts alphabetically. When I called it from my page, it generated all sorts of SQL errors, again probably because a page was calling the plugin.
All comments appreciated!
thanks,
JF 😉Forum: Fixing WordPress
In reply to: alphabetical archivesHmm, I wasn’t being accurate at all: that isn’t an archive template, it’s a PAGE template.
I don’t really care if it’s a page or an archive, I just need the desired output: an alphebetized listing of ALL posts on the site.
Can anyone point the way?
I tried the following, but the result is one link (a link to the page itself).
<?php
/*
Template Name: Artists A-Z
*/
?>
<?php get_header(); ?>
<h1>Artists A-Z</h1>
<?php
$posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1');
if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="storycontent">
<ul>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?>
</a></li>
</ul>
</div>
<?php endwhile; else: ?>
<p>
<?php _e('Sorry, there are no artists in this category yet.'); ?>
</p>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>All comments appreciated!
JF 😉Forum: Everything else WordPress
In reply to: Security and WP 1.5.2Thank you so much!! Very helpful replies and exactly the answer I was looking for. Thank you!!!
JF 😉I’m in the same boat: I have several parent categories. Some of these have children categories. In the site-wide navigation, I’d like all categories with posts–including child cats–to show in the navigation. I would prefer to NOT assign the post to both the parent and child cateory just to get the child cat to display. I also don’t want to use
hide_empty=0since that will display ALL cats even if there are no posts–the opposite of what I’m trying to achieve.So, is there a way to display ALL cats, including children, only where there are posts in the cats?
THX!
JF 😉