simplistik
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Can't change the link hover color from black!Has nothing to do with WP, it’s all about your stylesheets.
Navigation issue is this rule
#header-menu > li:hover, #header-menu > li.current-menu-item, #header-menu > li.current-menu-ancestor { background: url(images/sprite_h.png) left -4px repeat-x #eee; }
line 31 of style-light.css
Links issue is this rule
a:hover { color: #0d0d0d; text-decoration: none; }
line 56 of page.css
Forum: Fixing WordPress
In reply to: links still point to staging siteThey all seem to be pointing to https://www.cliveleach.com/
Forum: Fixing WordPress
In reply to: Pagination to ImagesActually if you don’t need the flexibility of say, being able to associate robust content w/ your imagery, it might just be simpler to use NextGEN: https://www.ads-software.com/extend/plugins/nextgen-gallery/ that would be the quickest.
Forum: Fixing WordPress
In reply to: Pagination to ImagesQuickest way, create a custom post type for your “products”, leverage the post-thumbnails support. In your “product” page loop through your products and inherit the native pagination support of wordpress. Things you could use to make your life easier:
Custom Post Types: https://www.ads-software.com/extend/plugins/custom-post-type-ui/
Pagination: https://www.ads-software.com/extend/plugins/wp-pagenavi/
Forum: Fixing WordPress
In reply to: query_posts with pagenavibecause you’re using a custom query loop you need to use this method:
https://scribu.net/wordpress/wp-pagenavi/wpn-2-74.htmlin that template looks like you just need to do
<?php if ( function_exists('wp_pagenavi') ) wp_pagenavi(array('query' => $wp_query)); ?>
Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?It’s not hard to call the posts, I do it all the time, which is why this is baffling. For now, try one thing and that’s just replacing
$args['posts_per_page'] = $posts;
with$args['posts_per_page'] = 5;
and see what happens. Outside of that I’ve pretty much exhausted everything I can think of to solve it, so w/o touching the actual files, I dunno where to go from there.Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?LOL to be honest it’s just all kinda strange, something should work.
- Did you try hard coding the 5 into the
$args['posts_per_page'] = $posts;
change it to$args['posts_per_page'] = 5;
. - Next thing to ask is to make sure that all the items you’re calling are in fact posts, and not some other post_type.
- Inside the original function we are screwing with do a
print_r
on$popular
:$popular = new WP_Query($args); print_r($popular);
View source on your page, and check the query that it’s outputting in the object and make sure that it’s correct (or post the whole object array here)
Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?oh, hrm you know what … this just occurred to me LOL and I feel like an arse, and it could’ve saved a lot of trouble, you’re calling the function
tj_tabs_popular()
somewhere in your theme, I bet it’s set to only call 1 post, so you’ll see something liketj_tabs_popular(1)
somewhere. To check if this is the case change$args['posts_per_page'] = $posts;
to$args['posts_per_page'] = 5;
see what happens if it does show the last 5 then find the place wheretj_tabs_popular()
is being called and and switch that 1 to a 5, or just leave it out.And I was mistaken I was able to get
array(603,654,657,714,724)
working just fine, looks like I had a caching issue.Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?Yea, I assumed
$args['post_type'] = 'post';
would do nothing since it’s the default, go ahead and remove the post_type argument.I had to give in and open up a WordPress site to test this out, cause this is a weird friggen problem. So here’s the deal, the codex says to use
post__in
like:array(603,654,657,714,724)
https://codex.www.ads-software.com/Class_Reference/WP_Query#Parametersthis seems to work for everything except posts, to get it to work for posts i had to do:
array('603','654','657','714','724');
so you should have
$args = array(); $args['posts_per_page'] = $posts; $args['post__in'] = array('603','654','657','714','724'); $args['ignore_sticky_posts'] = 1; $args['orderby'] = 'ID';
try that, lemme know how it goes
Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?Also if those IDs are a mixture of posts and pages you will have to do:
$args['post_type'] = array('post','page');
Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?Hrmmmm, I guess try setting the post_type after the orderby… lol, add
$args['post_type'] = 'post';
if you want posts or
$args['post_type'] = 'page';
if you want pages or if post doesn’t work … LoL
Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?$the_query = new WP_Query($args);
should be$popular = new WP_Query($args);
I’m only assuming that’s line 401ishLooks like you changed this line:
while ($popular->have_posts()) : $popular->the_post();
from using$the_query->
to using$popular->
Forum: Fixing WordPress
In reply to: get_header includeTo be honest I’m not sure. It’s isolated to the front end of WordPress. I used to encounter this issue a lot, and that’s the only way I know to fix it. I know that the function that gets used inside of the
get_header()
function is arequire_once()
but it’s still strange none-the-less.Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?Yea, I write my queries in a more legible manner so this will look different, I also noticed that, the script might be using depreciated parameters depending on what version of WP you’re using. But lets try this, replace that whole $the_query stuff with:
<?php $args = array(); $args['posts_per_page'] = $posts; $args['post__in'] = array(603,654,657,714,724); $args['ignore_sticky_posts'] = 1; $args['orderby'] = 'ID'; $the_query = new WP_Query($args); ?>
depending on how you want your entries ordered you can put
$args['order'] = 'ASC';
just below$args['orderby'] = 'ID';
DESC is the default so you won’t need to define it if that’s how you want the order.** edited … make sure there are quotes around ID, forgot to add them in my first version of this post
Forum: Fixing WordPress
In reply to: How do I sort posts by page ID in this function?You haven’t changed the
$orderby
, if you read it, it still shows $orderby, with the dollar sign it needs to be the ampersand&orderby
$the_query = new WP_Query('showposts='. $posts .'&orderby=ID&include=603,654,657,714,724');
should be the exact code
- Did you try hard coding the 5 into the