victorfliks
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: 500 Internal Service Errorhave you tried to reset your permalink structure??
if your main page still appear, but all of the other page redirect you to 500 internal server error, try to reset your permalink structure…
go to wp-admin -> setting -> permalink..
and choose save setting…Forum: Fixing WordPress
In reply to: Pagination Error 404 on specific pagei’ve found a solution
i’ve added this into function.php
function my_post_queries( $query ) { // do not alter the query on wp-admin pages and only alter it if it's the main query if (!is_admin() && $query->is_main_query()){ // alter the query for the home and category pages if(is_home()){ $query->set('posts_per_page', 1); // changed from 3 to 1... } if(is_category()){ $query->set('posts_per_page', 3); } } } add_action( 'pre_get_posts', 'my_post_queries' );now i can switch into diffrent page without error, but there are some downside..
because i’m using it on index.php, if i set the
$query->set('posts_per_page', 1);i can open page up to ‘www.example.com/page/12’ that means that in index.php i’ve outputed 12 post…so for my solution…
first if anyone using pagination on index.php add this on function.php
function my_post_queries( $query ) { // do not alter the query on wp-admin pages and only alter it if it's the main query if (!is_admin() && $query->is_main_query()){ // alter the query for the home pages if(is_home()){ $query->set('cat','2') // this means select all post from category ID 2... $query->set('posts_per_page', 1); // this means set maximum post outputted on index.php // basic calculation how many pages generated: if on category ID 2 you have 4 post, that means 4 / 1(from posts_per_page) equal to 4 pages generated... } } } add_action( 'pre_get_posts', 'my_post_queries' );on index.php use the keesiemeijer method by using wp_query…
and thats all..
hope this is the best method for me, and fell free if you have another suggestion regarding pagination…
thank you so much for keesiemeijer for helping me…. 😀
Forum: Fixing WordPress
In reply to: Pagination Error 404 on specific pagehi keesiemeijer, i’ve used your method and change all the
query_poststo wp_query, i named it query_one, query_two and query_three…the number of page display is correct, they show 8 pages on pagination (based on: how many post/posts_per_page), but the conflict still appear, when i choose page number 5, they still redirect me to 404…
so in my opinion, my wordpress redirect me to 404 because they don’t create page ‘www.example.com/page/5’ an so on… even though i’ve created the permalink for page above 4….
my permalink structure, is http://www.example.com/postname…
Thank You Very Much..
Forum: Fixing WordPress
In reply to: Pagination Error 404 on specific pageow yeah, i forgot to tell, that this code is in index.php i dont using page templates on this one…..
Forum: Fixing WordPress
In reply to: Pagination Error 404 on specific pageThank you for the reply,
yes, i’m using page templates, by creating template.php and set template name etc..
ok, i will test the code on my office tomorrow, i will reply you whenever it’s work or not 😀
sorry for asking, but
page template are the only method i know to make pages, are there any other (save) method to create a page.. Or should i stick to page template method on my other wordpress project..Thank You Very Much…