Custom role can’t create permalink
Found that it works if I add the edit_posts capacity. But Posts is now visible in Admin 🙁 At the same time, it also fixed a problem I had with Media upload: the user could never edit right after the upload.
Found that it works if I add the edit_posts capacity. But Posts is now visible in Admin 🙁 At the same time, it also fixed a problem I had with Media upload: the user could never edit right after the upload.
I had to modify queries before they run. So the best practice was to add the following code to function.php: if (!function_exists(‘my_theme_filter’)) { function my_theme_filter( $query ){ if ( $query->is_main_query() ) if ( $query->get( ‘tag’ ) OR is_search() ) $query->set( ‘post_type’, array( ‘artprim_item’ ) ); //echo ‘<pre>’; print_r($query); echo ‘</pre>’; return $query; }} add_filter( ‘pre_get_posts’, … Read more
From codex – you should be able to use taxonomy-service-category.php template to display service-category posts.
wp_trash_post and trashed_post – from source: function wp_trash_post($post_id = 0) { if ( !EMPTY_TRASH_DAYS ) return wp_delete_post($post_id, true); if ( !$post = wp_get_single_post($post_id, ARRAY_A) ) return $post; if ( $post[‘post_status’] == ‘trash’ ) return false; do_action(‘wp_trash_post’, $post_id); add_post_meta($post_id,’_wp_trash_meta_status’, $post[‘post_status’]); add_post_meta($post_id,’_wp_trash_meta_time’, time()); $post[‘post_status’] = ‘trash’; wp_insert_post($post); wp_trash_post_comments($post_id); do_action(‘trashed_post’, $post_id); return $post; }
Try this (untested): <?php $prevPost = get_previous_post(); foreach ($prevPost as $postPrev) { if ( has_post_thumbnail($postPrev->ID)) { $prevThumbnail = get_the_post_thumbnail($postPrev->ID, array(150,150) ); previous_post_link( ‘%link’, $prevThumbnail ); } } ?>
I think those extra parameters in url (after-#) are generated to make that plugin work with browser history. I think the plugin doesn’t loading required javascript to popup full sized images. thats why it only updating url but not showing full sized image. See the source code of page to make sure you’re loading all … Read more
There is the built in post thumbnail. WordPress will keep track of it and you can use the_post_thumbnail to display wherever needed.
I’d use a custom table for this. Otherwise you’d have to have a lot of custom post types posts containing very little information. Your own table is easier to manipulate (and, god forbid, export should you want to use another high score solution).
The problem was that one cannot apparently set ‘posts_per_page’ to anything other than what is set in the admin interface, even for a custom archive page. The same code, minus the ‘posts_per_page’ => ‘x’ line, works fine.
For sure. Just set your structure to: /blog/%postname%/ or /blog/%category%/%postname%/. Permalink structure is only for posts ;D