RyanJenkins
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Expound] Featured post up top, then four-post rowGreat! That put the one large post at the top. And if I set several posts as sticky, they will appear below the top one in a row?
Forum: Fixing WordPress
In reply to: Incrementing the Loop manuallyFantastic, perfect, thanks a million.
Forum: Fixing WordPress
In reply to: Using The Loop with the backend editorThat did not work. I am content, for now to leave it like this:
if (is_page('36') ) { // Larry Bostic tag 30 $tag = 'Larry Bostic'; } ... $profiles->query("tag=$tag");Appreciate it. This page likely won’t be expanded too often, so it’s alright to keep doing it manually. I will mark as resolved. Ryan
Forum: Fixing WordPress
In reply to: Using The Loop with the backend editorOkay, so I got this:
if (is_page('36') ) { // Larry Bostic tag 30 $tag = 'Larry-Bostic';} ... $profiles->query("tag=$tag"); ?>And that works just fine. Before I go this route completely, is there a way to pass just the tag ID number? Again, I feel more comfortable passing numbers than strings. Thanks.
Forum: Fixing WordPress
In reply to: Using The Loop with the backend editorNow I am looking to do the same thing, except with tags instead of categories.
Here is my code, largely adopted from this Codex page: http://codex.wordpress.org/Template_Tags/query_posts
<?php $tag = ''; if (is_page('36') ) { // Larry Bostic tag 30 $tag = 30; } elseif ( is_page('38') ) { // Orlando Boquete tag 31 $tag = 31; } elseif ( is_page('11') ) { // Alan Crotzer tag 32 $tag = 32; // ...etc... echo($tag); if ($tag) { $profiles = new WP_Query(); $profiles->query("tag=$tag"); ?> <ul> <!-- Put an if statement to have a header "Related news items about $title..." --> <?php while ($profiles->have_posts()) : $profiles->the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> <?php } ?>The problem is that I can’t find an example of
querybeing run and using only the tag ID number. This is a bit easier, I think, but I could just as quickly use a string that’s the actual tag’s name. So, instead of using$tag = 30;for Larry Bostic, using$tag = ‘Larry Bostic’`.First, is there a way just to do this using the tag ID, which I think is more reliable/trustworthy than using the actual string? If there’s not, then I’d like an example of using the syntax to define
$tag, and then passing it or using it to query.Thanks!
Forum: Fixing WordPress
In reply to: Using The Loop with the backend editorOh, also, it wasn’t filtering categories correctly when I first implemented it and I had to figure out why. Here is why. On this line:
$profiles->query("showposts=5&cat=$cat"); ?>I had to change the
&to an actual ampersand (&). This might have been the fault of the browser you were using to post or something. Just FYI.Edit: my browser just did it, too. Maybe it is the fault of WP’s forums.
Forum: Fixing WordPress
In reply to: Using The Loop with the backend editorExcellent, thanks for the code. I modified it a little to fit my needs, and it’s looking great. I just put a mini-version on my Press Releases page to pull from that category, and it works just fine. Now I get to have fun formatting the output. I’ll be back here if I run into problems with the full deployment in a day or two. Thanks again! Ryan
Forum: Fixing WordPress
In reply to: Using The Loop with the backend editorSo, since I have several different pages that will require different categories of posts be loaded, will that template have a big if/else structure like this in it, one that is manually maintained? I took this example off of the page you sent:
<?php if (is_page('21') ) { $cat = array(12); } elseif ( is_page('16') ) { $cat = array(32); } elseif ( is_page('28') ) { $cat = array(17); } else { $cat = ''; }“A Page of Posts,” I think that’s right. Although, I’m going to have to have two loops there, I’m going to have to have the loop that displays the regular
the_contentorthe_postfrom that page, and then also generates this little list off to the side… Am I on the right track? Thanks for the info.Forum: Fixing WordPress
In reply to: Distinguish between pages and posts in search.phpI had to jigger the if/else syntax, because I am new to PHP, but it worked.
Fantastic, resolved, done. Thanks!