yekxmerr
Forum Replies Created
-
Forum: Hacks
In reply to: Need Help on WP_QuerySoz i’m a noob. Forgot the get_previous_post!
Solved
Forum: Fixing WordPress
In reply to: Show Popular Posts – Best way to do it?Thanks for the input, but i was looking for an expert opinion.
Forum: Fixing WordPress
In reply to: Change Title of All PostsOk, i’ve read some SQL because i was a bit rusty and i got the queries. After that i export it to CSV and then edit it manually. Now i don’t know how to upload the file because it lists only the post titles.
Forum: Fixing WordPress
In reply to: Multiple Loops and Duplicate IssuesAlchymyth you’re amazing!
It work, and it seems not to affect the pagination.
Thank you for helping me out.Forum: Fixing WordPress
In reply to: Multiple Loops and Duplicate IssuesThe thing is $popular_loop displays the most viewed posts and the main loop displays the normal posts, without the most viewed ones from the $popular_loop. The code above is updated to query_posts, but it’s the same thing.
Forum: Fixing WordPress
In reply to: Multiple Loops and Duplicate IssuesHere you go, i solved it with query_posts but the archive.php is similar to the index file so the problem will persist.
Forum: Fixing WordPress
In reply to: Multiple Loops and Duplicate IssuesIt works if i use the query_posts on main loop:
<?php query_posts(array('post__not_in'=>$do_not_duplicate)); if (have_posts()) : while (have_posts()) : the_post(); ?>
Can’t understand why my way didn’t work.
Forum: Fixing WordPress
In reply to: [Loop] Multiple loops on a category templateOk after some hours i got this working:
Wp_query:<?php $cat_ID = get_query_var('cat'); $popular_loop = new WP_Query('cat='.$cat_ID.'&showposts=3&v_sortby=views'); if( $popular_loop->have_posts() ): while( $popular_loop->have_posts() ): $popular_loop->the_post(); $do_not_duplicate[] = $post->ID; ?>
Main Loop:
<?php if (have_posts()) : while (have_posts()) : the_post(); if(in_array($post->ID, $do_not_duplicate)) continue; ?>
Forum: Fixing WordPress
In reply to: [Loop] Multiple loops on a category templateI’m still working on this and i can’t get it done.
It is a category.php theme file and i have a normal loop to display the category posts, and now i need a wp_query to show the popular posts of the same category, but this wp_query is displayed first (don’t know if this matters).
Getting killed on this lolForum: Fixing WordPress
In reply to: [Loop] Multiple loops on a category templateI still can’t get there. Damn this isn’t easy but i won’t rest until i get this to work. The problem is my lack of skills in php ??
I still can’t get the category id from the main loop, and avoid the duplicate issues on the wp_query.
Simple Mode On:– Query1( Wp_query that lists the 4 most popular posts of the main loop category, avoiding the duplicate on the main loop )
&
– Query2 ( Main Loop that lists the posts from the current category and i have a pre_get_posts hook that forces it to list 36 posts per page and it needs to avoid duplicated content from the wp_query )Forum: Fixing WordPress
In reply to: [Loop] Multiple loops on a category templateUpdate: The problem i’m facing now is that i need to create a WP_query that gets the top 4 most viewed post (this i know how) and in the category of the main loop (this i don’t).
So i need to extract the category id or something from the main loop into a variable and then get it in the wp_query? Or there is a simple way to achieve this?Update2:
I used this on the main loop:
<?php global $post; if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; ?>
And this on the wp_query:<?php $popular_loop = new WP_Query(array('v_sortby' => 'views', 'v_orderby' => 'desc', 'posts_per_page' => '4', 'cat' => $post>category_id)); if( $popular_loop->have_posts() ): while( $popular_loop->have_posts() ): $popular_loop->the_post(); $do_not_duplicate = $post->ID; ?>
But right now i get the data backwards but i think i can fix it. Are the queries ok?
Forum: Fixing WordPress
In reply to: [Loop] Multiple loops on a category templateOk i’m using now the pre_get_posts and wow it’s awesome. But this still doesn’t solve my problem.
$query->set( 'cat', '-5' );
I would need it to use the current category but i don’t know how to achieve this. I think i need to call $args but i’m not shure.And i have another problem, i have this wp_query
<?php $popular_loop = new WP_Query( array('v_sortby' => 'views', 'v_orderby' => 'desc', 'posts_per_page' => '4' )); if( $popular_loop->have_posts() ): while( $popular_loop->have_posts() ): $popular_loop->the_post(); ?>
But this code will call out all the posts and i need to get the popular ones on the category i’m currently on.
Sorry for asking this questions, these are probably WordPress dummy stuffForum: Fixing WordPress
In reply to: [Loop] Multiple loops on a category templateSorry for not being very specific. My problem is that i want to exclude posts on the main loop, and this posts are in a wp_query.
Example:
In my category template i show the top 5 popular posts across the pages, and i want to avoid duplicated content on the main loop.Forum: Plugins
In reply to: [W3 Total Cache] Updated W3Cache and now very slowSame here.
If i had 2 websites on my vps i think i could crash the server rack lol. It only gives me problems when i log to the administration and ff i stay out of it the site is ok. When i need to post or do anything in the administration i deactivate the plugin (sometimes it isn’t an easy task).
Waiting for a fix.Forum: Themes and Templates
In reply to: [Custom Theme] Need help to check my PHP code.Ok i’ve discovered that it isn’t a template issue and i tweaked my code using the codex.
Thanks anyway.