Show monthly or daily archives

Before WordPress 4.1, you can show the date archive page titles with the following code: (Taken and slightly modified from the twentyfourteen theme) if ( is_day() ) { printf( __( ‘Daily Archives: %s’, ‘twentyfourteen’ ), get_the_date() ); } elseif ( is_month() ) { printf( __( ‘Monthly Archives: %s’, ‘twentyfourteen’ ), get_the_date( _x( ‘F Y’, ‘monthly … Read more

A problem with date archives

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

How to create an archive section of a WordPress site

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

How can i display in themplate file only a few post

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

Create archives by author role

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

Exclude a specific category link from archive / front page

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 ) );

techhipbettruvabetnorabahisbahis forumueduedusedueduedueduedueduedusedus