giant slayer
Forum Replies Created
-
Forum: Plugins
In reply to: How to display fatal PHP errorsI am having the same issue now. Previously, I was getting the php error displaying on the web browser with the error type and the line number it was on, but with the latest wordpress upgrade, I am no longer seeing the php errors on the screen. Now it is just showing a blank page.
Forum: Fixing WordPress
In reply to: Using Page Navigation with custom time based queryThis is very discourging. I cannot get the page navigation to work with anything I have tried.
I have tried
$page = (get_query_var('page')) ? get_query_var('page') : 1;
and
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
and
$wp_query->set('page','1');
I have put paged argument within the query
query_posts( array('paged'=> $page ,'posts_per_page'=>9,'cat'=>6,'orderby'=>'rand' ) );
All of these set the page number to be 1. They create the nav link to go to the next page which is {https://theviolent.net/recent-works/page/2/} But when the link is clicked, it returns a page not found error.Forum: Fixing WordPress
In reply to: Using Page Navigation with custom time based queryThe codex says for pagination to work, one should set get_query_var( ‘page’);
Pagination Note: You should set get_query_var( ‘page’ ); if you want your query to work with pagination. Since WordPress 3.0.2, you do get_query_var( ‘page’ ) instead of get_query_var( ‘paged’ ). The pagination parameter ‘paged’ for WP_Query() remains the same.
How do I go about doing this?
Forum: Fixing WordPress
In reply to: Using Page Navigation with custom time based queryI found that the archive links do what I want as far as pulling posts from a selected date range and then having the paging and navigation links working correctly.
Does anyone know how to implement this same thing for a custom date range?
Thanks,
–christopherForum: Fixing WordPress
In reply to: Using Page Navigation with custom time based queryI appologize for the long code blocks. I am not sure why they did that.
Forum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderMac,
If you would like, for your help, I’d love to send you a 5×7 print of one of my fine art pieces. If you would like to browse through my work and pick a piece you like, I will gladly mail it out to you.
You can email the title of the one you want along with your address at cmgdesignstudios[at]theviolent.netForum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderThat worked perfectly. Thanks so much for your help. If there is anything I can do in return, please let me know, and I will be glad to do what I can.
Forum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderOk, here is what it printed.
IN FILTER: ORDER BY rand() QUERY:SELECT wp_term_taxonomy.term_id FROM wp_term_taxonomy INNER JOIN wp_terms USING (term_id) WHERE taxonomy = 'category' AND wp_terms.slug IN ('inspirational') IN FILTER: ORDER BY rand() QUERY:SELECT term_taxonomy_id FROM wp_term_taxonomy WHERE taxonomy = 'category' AND term_id IN (69) IN FILTER: ORDER BY rand() QUERY:SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'category' AND t.slug = 'inspirational' LIMIT 1 IN FILTER: ORDER BY rand() QUERY: SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (76) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY rand() DESC LIMIT 0, 9 IN FILTER: ORDER BY rand() QUERY:SELECT FOUND_ROWS()
It looks like the function got called 9 times, once for each image(post) being displayed.
Forum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderHere it is.
https://pastebin.com/bLpnZPFmForum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderFor my inspirational gallery, this is the query which was printed for page 1.
QUERY: SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (76) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY RAND() DESC LIMIT 0, 9
It does not appear the rand() function is receiving the seed.
Forum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderhmmmm….
I tried it and still no success. Here is my code.// Retrieve consistent random set of posts with pagination function mam_posts_query($query) { global $mam_posts_query; if ($mam_posts_query && strpos($query, 'ORDER BY RAND()') !== false) { $query = str_replace('ORDER BY RAND()',$mam_posts_query,$query); } return $query; } add_filter('query','mam_posts_query'); $seed = gregoriantojd(date('h'),date('m'),date('d'),date('Y')); global $mam_posts_query; $mam_posts_query = " ORDER BY rand($seed) "; // Turn on filter query_posts($query_string . '&orderby=rand'); $mam_posts_query = ''; // Turn off filter
If you visit any of the menu items from my page, you can see that they are still random, but are still re-randomized when visiting 2nd and 3rd pages. Each refresh is also randomizing.
Forum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderI commented out my original
query_posts
and used the code you sent.Forum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderHere is the link.
https://pastebin.com/6AU62BEqForum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderWhen I use your query, my category value passed to me from WordPress is lost. It is in the $query_string variable.
Forum: Fixing WordPress
In reply to: Getting Navigation to work with random post orderOne question.
query_posts($query_string . '&orderby=rand');
In my original query, I have my $query_string which has values passed to it from WordPress. How do I add the random from your code and still keep the value in the $query_string?