MekZii
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Fixing WordPress
In reply to: [global $wp_query and get_query_var()] Don't return the same valuesSo no one knows and can help me out why get_query_var( ‘max_num_pages’ ); doesnt get me the same result as $wp_query->max_num_pages;.
Forum: Fixing WordPress
In reply to: Custom post type is seen as 'standard'I need to use get_post_type() instead of get_post_format().
Forum: Fixing WordPress
In reply to: How to change the automatic slug format?The above is solved by adding this to a function that is hooked to ‘save_post’.
<?php if (!wp_is_post_revision($post_id) and empty($_POST['post_name'])) { // unhook this function so it doesn't loop infinitely remove_action('save_post', 'wpf_quote_save'); // update the post, which calls save_post again wp_update_post(array('ID' => $post_id, 'post_name' => $post->post_type . '-' . $post_id)); // re-hook this function add_action('save_post', 'wpf_quote_save'); } ?>Forum: Fixing WordPress
In reply to: Can't get custom meta box workingAfter a few hours searching on google and reading trough some article’s I just started commenting out some parts of the code until I found the line that made the error show up again. And that was:
if (!current_user_can(‘edit_post’))It should have been:
if (!current_user_can(‘edit_posts’))-.- 1 Freaking letter.
Viewing 4 replies - 1 through 4 (of 4 total)