dbunit16
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Amazon Style StoreTo clarify, no e-commerce is needed. I will just be linking so that products can be purchased elsehwere. I just need to be able to display product images.
Can I create a custom field where I assign an image to each post, then bring up that image on a static main page, or and a customized category page?
Thanks!
Forum: Themes and Templates
In reply to: Help with The LoopAhhh! This is so frustrating! Here is my entire page! Thank you all for the help! BTW, I’m running 2.5.1, is that makes any difference…
<?php /* Template Name: Suns2 */ ?> <?php get_header(); ?> <body> <!-- header --> <div id="header"> <div id="logo"> <h1> <a href="http://www.azfans.com" title="azFans.com - Smarter. Prouder. Louder."><span></span>azFans.com</a> </h1> </div> </div> <!-- navigation bar --> <div id="navcontainer"> <ul id="navlist"> <li><a id="tabz" class="active" href="/" title="The home for Arizona sports fans!">Home</a></li> <li><a id="taba" href="/blogs/" title="Read and write about your favorite Arizona sports teams and players!">Blogs</a></li> <li><a id="tabb" href="/forums/" title="Discuss hot topics in the world of desert sports!">Forums</a></li> <li><a id="tabc" href="/store/" title="Shop for Arizona sports fan apparel, jerseys, hats, and more!">Store</a></li> </ul> <ul id="teamlist"> <li><a id="tabd" href="/suns/" title="The latest on Steve Nash, Amare Stoudemire, and the rest of the Phoenix Suns!">Suns</a></li> <li><a id="tabe" href="/d-backs/" title="The inside scoop on your NL West Champion Arizona Diamondbacks!">D-Backs</a></li> <li><a id="tabf" href="/cardinals/" title="News and notes on Matt Leinart and your Arizona Cardinals!">Cardinals</a></li> <li><a id="tabg" href="/coyotes/" title="Phoenix Coyotes news, blogs, and discussions!">Coyotes</a></li> <li><a id="tabh" href="/more/" title="More Arizona Sports Teams!">+ More</a> <ul> <li><a href="" title="Arizona State University Sun Devils">Sun Devils</a></li> <li><a href="" title="University of Arizona Wildcats">Wildcats</a></li> <li><a href="" title="Northern Arizona Univesity Lumberjacks">Lumberjacks</a></li> <li><a href="" title="Phoenix Mercury basketball">Mercury</a></li> <li><a href="" title="Arizona Rattlers arena football">Rattlers</a></li> <li><a href="" title="Arizona high school sports">High School</a></li> </ul> </li> </ul> <ul id="joinlist"> <li><a id="tabi" href="/join/" title="Become an azFan today! Free!">Join Now!</a></li> </ul> </div> <div id="topbarcontainer"> <ul id="secondtopnavlist"> <li><a id="tabb" href="/blogs/" >Recent Posts</a></li> <li><a id="tabc" href="/forums/" >Top Posts</a></li> <li><a id="tabd" href="/forums/" >Top Blogs</a></li> <li><a id="tabd" href="/forums/" >Tags</a></li> <li><a id="tabd" href="/forums/" >Get a Blog</a></li> </ul> <div id="search"> <span class="date">Search:</span><input type="text" name="textfield" class="textarea"> </div> </div> <div id="container"> <div id="main"> <h3><a href="http://www.azfans.com/thewire">Recent Blog Posts</a></h3> <a href="#" class="rsslink">Subscribe</a> <?php $my_query = new WP_Query('category_name=suns&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?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); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; endif; ?> <h3><?php _e('Latest Forum Posts'); ?></h3> <?php // Get RSS Feed(s) include_once(ABSPATH . WPINC . '/rss.php'); $rss = fetch_rss('http://azfans.com/forums/external.php?type=RSS2&forumids=2'); $maxitems = 10; $items = array_slice($rss->items, 0, $maxitems); ?> <ul> <?php if (empty($items)) echo '<li>No items</li>'; else foreach ( $items as $item ) : ?> <li><a href='<?php echo $item['link']; ?>' title='<?php echo $item['title']; ?>'> <?php echo $item['title']; ?> </a><?php echo $item['pubDate']; ?></li> <?php endforeach; ?> </ul> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>Forum: Themes and Templates
In reply to: Help with The LoopGood catch, I must have pasted incorrectly!
I have edited for it to read:
<?php $my_query = new WP_Query('category_name=suns&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?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); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; endif; ?>I have put this up at http://www.azfans.com/blogs/suns2/
For some reason the rest of the posts beyond the first aren’t showing up! Also, the title of the page (Suns2) is showing up below the first item!
Forum: Fixing WordPress
In reply to: Display posts from CategorySo i managed to find out that this requires multiple loops. I copied the code exactly from http://codex.wordpress.org/The_Loop but still it’s not showing up. I get a blank page at http://www.azfans.com/blogs/suns
<?php $my_query = new WP_Query('category_name=Suns&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> <?php endwhile; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> <?php endwhile; endif; ?>Also, how would I change the second loop to only pull from the Suns or 3 category?
Help is greatly appreciated! Thank you!
Forum: Fixing WordPress
In reply to: Display posts from CategoryThanks mercime. I did look at that. I will be customizing my category templates as well, however, I want to keep their index.php structure in tack.
The page I want to create will NOT be a substitute for the category pages. I still want to have the category pages, but want to create a template where i can specify the latest number of x posts from x category.
Where the first post has most information, and the following x posts show simply the date, title, and link. Can you help?
Thanks,
Jon