greencode
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Page array not workingUmm, I tried this instead
<?php $args = array( 'post_type' => 'page', 'post__in' => get_post_meta($post->ID, "page_id") ); query_posts($args); ?>But still only one page displays.
I then tried
<?php $args = array( 'post_type' => 'page', 'post__in' => array(get_post_meta($post->ID, "page_id", false)) ); query_posts($args); ?>and nothing displays.
I tried this, just to make sure it was working when not using the custom field value
<?php $args = array( 'post_type' => 'page', 'post__in' => array(361,363) ); query_posts($args); ?>and it displays okay
Okay, thanks. I will do. If I get any results I’ll let you know.
Umm, replacing the code
$result = $wpdb->get_results("SELECT DISTINCT p.* FROM $wpdb->posts AS p $join $where $sort");on line 204 with
global $table_prefix; if ( function_exists('icl_sitepress_activate') ) { $result = $wpdb->get_results("SELECT DISTINCT p.* FROM $wpdb->posts AS p,{$table_prefix}icl_translations AS icl_translations $join $where AND p.ID = icl_translations.element_id AND icl_translations.language_code = '" . ICL_LANGUAGE_CODE . "' $sort"); } else { $result = $wpdb->get_results("SELECT DISTINCT p.* FROM $wpdb->posts AS p $join $where $sort"); }causes nothing to display in either default or foreign language.
I’m using this code to display the previous/next nav
<div class="nav-arrows-head"> <div class="nav-previous"><?php previous_post_link_plus( array('order_by' => 'menu_order', 'in_same_cat' => true, 'loop' => true, 'format' => '%link', 'link' => 'Previous') ); ?></div> <div class="nav-next"><?php next_post_link_plus( array('order_by' => 'menu_order', 'in_same_cat' => true, 'loop' => true, 'format' => '%link', 'link' => 'Next') ); ?></div> </div>Any ideas?
Apologies. Could you add the code how it should be. Not sure where the } needs to go.
Thanks.
Forum: Fixing WordPress
In reply to: if in taxonomyAh! Looks like I’ve found the answer:
<?php if ( has_term( 'countryside','collection' )) { echo 'Works'; } else { echo 'Does not work!'; } ?>There’s actually 2 x readme files. One at root (you don’t want that) and one in this folder:
members/docs/readme.html#shortcodes
Forum: Fixing WordPress
In reply to: Sticky Posts in WP_QueryThanks for this. I’ve tried using this but what seems to happen is the sticky post then also shows up in the second loop. here’s my code:
<?php $temp = $wp_query; $wp_query = new WP_Query( array( 'posts_per_page' => '-1', 'paged' => $paged, 'cat' => 275, 'post__in' => get_option('sticky_posts'))); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <a href="<?php the_permalink() ?>"><?php the_title() ?></a> <?php endwhile;?> <?php wp_reset_postdata(); ?> <?php $temp = $wp_query; global $more; $more = 0; $wp_query = new WP_Query( array( 'posts_per_page' => '10', 'ignore_sticky_posts' => 1, 'post__not_in' => $sticky, 'paged' => $paged, 'cat' => 275)); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <a href="<?php the_permalink() ?>"><?php the_title() ?></a> <?php endwhile;?> <?php wp_reset_postdata(); ?> <div class="grid_9"> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>Forum: Fixing WordPress
In reply to: Category or Page?Oooh, I like that idea. Very neat.
I suppose with regards to the slugs I’ll just have to name the categories something like blog-category, news-category etc so I can then call the pages blog, news etc.
Forum: Fixing WordPress
In reply to: Different number of posts on category page 1Great, thanks again.
Forum: Fixing WordPress
In reply to: Different number of posts on category page 1Thank you sooooooo much for this. It works absolutely perfectly. Really appreciate your constant help on this issue. I wouldn’t have had a clue where to begin with this.
Forum: Fixing WordPress
In reply to: Different number of posts on category page 1Hi. I’ve also got a news category that has only 6 posts but what’s happening is the first 5 are showing on the first page – as they should – and the page numbers are showing as 1 and 2 – again correct – but if I click page 2 I get a Page Not found. I then just increased the number of posts showing on the home page from 5 to 10 and all posts are then showing but the page numbers 1 and 2 are still showing!
Really lost with this one.
Forum: Fixing WordPress
In reply to: Different number of posts on category page 1So sorry not to get back to you about this. I’ve been fighting fires with fires at work!
I tried exactly as you mentioned in your previous message but I get the following error when attempting to view that category:
Fatal error: Call to undefined method WP_Query::is_main_query() in /home/mysite/public_html/dev/wp-content/themes/mytheme/functions.php on line 16
Any ideas?
Forum: Plugins
In reply to: [Easy Table] [Plugin: Easy Table] Commas in cells?Sorry. I just checked your site and can see I just need to enclose commas with quotes I.e. “red, blue, yellow”
Forum: Plugins
In reply to: [Breadcrumb NavXT] [Plugin: Breadcrumb NavXT] Compatibility request with WPMLApologies for not getting back to you regarding this. Been up to my neck in work at the minute. I’ll take a look this weekend if that’s okay.
Forum: Fixing WordPress
In reply to: post__not_in queryThanks for this – works perfectly