MaddTechWF
Forum Replies Created
-
Forum: Themes and Templates
In reply to: WordPress Loop and 3 items per rowI got it worked out finally. I had to change a few lines of code:
<?php query_posts( array ( 'category_name' => 'Portfolio', 'posts_per_page' => -1 ) ); ?>Forum: Themes and Templates
In reply to: WordPress Loop and 3 items per row@alchymyth – I thought I had it working but evidently not. The loop I have written only shows the most current post. It will not loop through and show them all.
<!-- Reset WordPress Query --> <?php wp_reset_query(); ?> <!-- Set Category Name to Portfolio-Item --> <?php query_posts( 'category_name=portfolio' ); ?> <div id="portfolio"> <div class="portfolio_box_container clearfix"> <!-- Declare Count for rows --> <?php $count=0; ?> <!-- Start WordPress Loop --> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ($count==0) : ?> <div class="portfolio-items"> <div class="cleardiv"></div> <?php endif; ?> <div class="portfolio_box"> <div class="image_skin"> <div class="image_inside_border"> <div class="image_holder"> <a href="<?php echo get_permalink(); ?>" alt="<?php the_title(); ?>"> <img src="<?php echo get_post_meta(get_the_ID(), 'post-thumbnail', true); ?>" alt="<?php the_title(); ?>" /> </a> </div> </div> </div> <div class="cleardiv"></div> </div> <?php $count++; ?> <?php if ($count==3 ||$wp_query->found_posts==0) : ?> <?php $count=0; ?> </div> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <h3>Sorry but there are no portfolio items.</h3> <?php endif; ?> <?php wp_reset_query(); ?> </div> </div> </div>I know the code might seem confusing but what I was trying to do is the following. I have a dive wrapped around each row. Which you will find inside the first IF statement inside the loop. Then it will parse the post info out and then check if the count is equal to three to see if it needs to close the div and reset the count to 0 so it will start the next row with the div from the first statement. I also have the second if checking to see if it is at the last post so it will close the row and not leave it open.
Forum: Themes and Templates
In reply to: WordPress Loop and 3 items per rowI have the HTML and CSS already made up. I just have to put a div wrapper around every 3 entries that are returned. I was just not sure how to modify the WordPress Loop to do this.
Forum: Themes and Templates
In reply to: Home PageI ended up using the following code:
<?php $my_query = new WP_Query('category_name=featured&showposts=3'); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <!-- Do special_cat stuff... --> <?php endwhile; ?>I found it on http://www.catswhocode.com/blog/multiple-wordpress-loops
Forum: Themes and Templates
In reply to: home.phpis_page(‘home’)
Forum: Themes and Templates
In reply to: WordPress MenuAny good reference material you can suggest? I’m really interested in building my own page menu generation function.
Forum: Themes and Templates
In reply to: WordPress MenuWell if there is a specific function that I need to switch to to get this working, I’m open for suggestions. I just used wp_nav_menu because that’s what I’m use to using.
Forum: Themes and Templates
In reply to: WordPress MenuI’m currently using this in my header.php:
<?php wp_nav_menu(array('menu' => 'Custom Menu' , 'menu_class' => 'level-1 black')); ?>Forum: Themes and Templates
In reply to: Header/Footer IssueI don’t have it live. It’s on my test server. I will google it.
Forum: Themes and Templates
In reply to: Header/Footer IssueJomsky,
When I use the above code, it leaves a white border around the top, left, and right sides of the images used for the background.Forum: Themes and Templates
In reply to: Body is not showing up correctlyI got it working. Had to add a margin-top: -8px to my logo. Sorry to bug anyone.
Forum: Themes and Templates
In reply to: Body is not showing up correctlyIt’s not live. I’m coding it on my local server.
Forum: Themes and Templates
In reply to: Body is not showing up correctly/*Container ----------------------------------------------------------------------------------------------------*/ .container_12 { margin-right: auto; margin-left: auto; width: 960px; }This is from my 960.css file.
Forum: Themes and Templates
In reply to: Pasing StringFound it. Forgot the $ between the . and the b.
Forum: Themes and Templates
In reply to: Pasing StringWhen I implement the above code, I get the word bit on each one of my list items. What am I doing wrong?