how to hide all posts under one category
You need a plugin like this https://wordpress.org/plugins/the-post-grid/ to show the post in grid view.
You need a plugin like this https://wordpress.org/plugins/the-post-grid/ to show the post in grid view.
The problem is that the plugin only handles the calendar part, and not the archive query. What you need to do: Change the main query on archive pages if the post_type argument is present, eg: http://localhost:8888/wp/?m=201105&post_type=candy : add_filter(‘pre_get_posts’, ‘atom_include_cpt_in_archives’); function atom_include_cpt_in_archives($query){ // validate if(is_archive() && isset($_GET[‘post_type’]) && post_type_exists($_GET[‘post_type’])) $query->set(‘post_type’, $_GET[‘post_type’]); return $query; } Next, you’ll … Read more
You could use Custom Post Types which will keep users from selecting a custom template. Here are a few links to help you get started: WordPress Codex (register post types) Think Vitamin Custom Post Types Tuturial Plug-ins: Custom Content Types Easy Post Types Custom Post Type UI For More Control you might use Custom Taxonomies … Read more
Ok. You are toggling your display according to a $_GET parameter that you have added to the URL– this switch in your archive.php $view = ‘poster’; $mode = stripslashes( $_GET[“afisare”] ); $modes = array(‘complex’, ‘simple’, ‘poster’); if(in_array($mode, $modes)) $view = $mode; get_template_part(‘persoane’, $view); You can alter how many posts will display but that is much … Read more
You may be able to abuse add_rewrite_endpoint for this purpose, depending on exactly what you want to do. Some examples: // add an endpoint // http:domain.com/role/ // http:domain.com/role/foo/ function wpa_add_role_endpoint(){ add_rewrite_endpoint( ‘role’, EP_ALL ); } add_action( ‘init’, ‘wpa_add_role_endpoint’ ); // check if a role parameter exists, like: // http:domain.com/role/foo/ function wpa_role_query( $query ){ if( $query->get(‘role’) … Read more
If you do not want to use the buildin archives, your best way of achieving this is to create a Page Template containing nearly the same code as the archive.php. Also, add some post_meta to your static pages, containing the Year and Month of the posts you want to show. In your page template, set … Read more
Assuming that you are using get_categories to print the category links, there is an exclude parameter. You need to use IDs, so you will need to convert the slug with get_term_by $cid = get_term_by(‘slug’,’update’,’category’); // var_dump($cid); get_categories( array( ‘exclude’ => $cid->term_id ) );
The Simple Yearly Archive Plugin does just that. This code will also do the trick: <?php // get years that have posts $years = $wpdb->get_results( “SELECT YEAR(post_date) AS year FROM wp_posts WHERE post_type=”post” AND post_status=”publish” GROUP BY year DESC” ); foreach ( $years as $year ) { // get posts for each year $posts_this_year = … Read more
No… Your users won’t receive the post again in their feeds when you click update button. That’s how WordPress works. So don’t be afraid to click update button Dashboard -> All Posts -> Edit -> Make changes -> Click update button PS: If you still afraid, do a little experiment. By default your feed url … Read more
The function get_posts() accepts a parameter ‘post__not_in’, which allows you to specify an array of post IDs to exclude from the query. get_posts() is just a wrapper for WP_Query, so the documentation for this parameter can be found here. When inside the loop (such as inside single-events.php) you can retrieve the current post’s ID with … Read more