gashface
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Posts per page missing 2 posts – Custom queryI just wondered if you’d manage to come up with any more ideas of what this could be?
Var dump – on further perusal I think it might actually be bringing through all posts? including past exhibitions, so those after the date (so past events) but this is probably because the if statement is after the dump?
Thanks
Forum: Fixing WordPress
In reply to: Posts per page missing 2 posts – Custom queryokay, thanks for the help! I appreciate it.
Forum: Fixing WordPress
In reply to: Posts per page missing 2 posts – Custom queryYeah I’ve tried that before. Even when using the default amount of posts and no paging (which consequently isn’t working either), it misses out two posts.
They all have the meta data too.
Is it possible the problem lies with the original functions in functions.php?
function get_exhibition_container() { global $post; ?> <section class="exhibition_container clearfix"> <?php the_post_thumbnail('slideshowad', array('class' => 'exhibition')); ?> <div class="left-column-short"> <p> <?php $custom = get_post_custom(); ?> <strong> <?php echo date("F d, Y",strtotime($custom["exhibition_start_date"][0])); ?> -<br/> <?php echo date("F d, Y",strtotime($custom["exhibition_end_date"][0])); ?> <?php echo get_post_meta($post->ID, 'exhibition_location', true); ?></strong> <br/> <em> <?php if($custom["exhibition_start_time"][0]); echo get_post_meta($post->ID, 'exhibition_start_time', true);' -' ?> <?php if($custom["exhibition_end_time"][0]); echo get_post_meta($post->ID, 'exhibition_end_time', true); ?></em> </div> <div class="right-column-long"> <div class="right-text"> <h2 class="caps"><?php echo '<a href="'. get_post_permalink($post->ID) . '">'. $post->post_title .'</a></h2>' ?> <?php the_excerpt($post->ID) ?> </div> </div> </section>
Forum: Fixing WordPress
In reply to: Posts per page missing 2 posts – Custom queryNope still missing two posts?
Forum: Hacks
In reply to: Shortcode printing the_content outside of html codeNotice: Undefined variable: content in /var/www/vhosts/thestudio.effectdigital.com/httpdocs/wp-content/themes/griffin-studio/functions.php on line 332
function get_event_container() { global $post; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); $ret = '<section class="event_container clearfix">'; $ret = $ret . get_event_details(false, true); $ret = $ret . '<div class="right-column-long"><div class="right-text">' . $content . '</div></div>'; $ret = $ret . '</section>'; return $ret; }
Forum: Hacks
In reply to: Shortcode printing the_content outside of html codeCool so how do I use the
<?php
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);
?>In my functions file, just delcaring $content inside my functions file doesn’t work, but I need to keep the formatting from the_content which get strips out
Forum: Fixing WordPress
In reply to: Blank logon pageWorked it out, space in the functions file, omg so simple!
Forum: Fixing WordPress
In reply to: Blank logon pageOk I’ve got the site showing but not the login screen still, any ideas?!
Forum: Fixing WordPress
In reply to: Blank logon pageCannot switch the theme because I can’t login anyway and yes I’ve tried that, no results ??
Forum: Themes and Templates
In reply to: Order by rand with no duplicatesThankyou that worked perfectly and I’ve changed to slugs (:
Forum: Themes and Templates
In reply to: Order by rand with no duplicatesOk I’ve managed to get it working, but occasionally my second loop only gets 2 posts instead of 3, any ideas?
Forum: Themes and Templates
In reply to: Order by rand with no duplicatesHi there. I am doing this, but it is still not working, any help?
I think maybe because this is assuming you’re getting the posts from the same category whereas I need to get them from two seperate ones, but were a post is in both, make sure only it is displayed once from one category?
Forum: Themes and Templates
In reply to: Order by rand with no duplicates[code moderated - please follow the forum guidelines for posting code]
So how would this work with this code?
Forum: Fixing WordPress
In reply to: Show 1 post from each category in a grid?Or actually this may work better, these categories are all in a parent category, so get 1 child category from the parent category and display 1 post from each of those child categories?
Forum: Fixing WordPress
In reply to: Get random posts from current category.Nevermind I have fixed it. for anybody else who is curious:
<?php $c = 1; //init counter $bpr = 3; //boxes per row foreach(get_the_category() as $category) { $cat = $category->cat_ID; } query_posts('cat=.$cat.&showposts=3&orderby=rand'); if(have_posts()) : while(have_posts()) : the_post(); ?>