Archive Listings Filtered by Date Values in a Custom Field/Post Meta?

As with many things in WordPress there are several ways to do what you want. I’m going to explain one of them. Remove the ‘year’, ‘monthnum’ and ‘day’ Query Variables You can modify the parameters to the query WordPress uses on the archive URLs inside the ‘pre_get_posts’ hook. Those parameters are captured as an associative … Read more

Custom Post Type Archives by Date with Custom Permalink

Here’s the solution: Install Custom Post Type Archives plugin Go to Settings->Post Type Archives Remove the url base option (leave it blank) Change the template pattern to archive-{POST_TYPE}.php Tick your custom post type and click save Rewrite/save your custom permalink structure Now your links press-release/%year% and press-release/%year%/%month% should work.

How do I display two separate taxonomy archives for two post types that share a single taxonomy?

According to the WordPress Codex archive-{post_type}.php So, in your case (depending on your naming): archive-products.php If you have a custom taxonomy archive also, then the challenge is structuring your archive to represent the proper taxonomy template. If you need to have a custom taxonomy archive, I would recommend that you use the post-type archive structure … Read more

How can I get posts in a subcategory to display on it’s parent categories archive page?

I ran another test and unless I’m loosing my mind child categories are definitely displayed on the category archive page in WordPress v3.0.1 (is that the version you are running, or are you on an earlier version?) Here are two screenshots, the first showing the category layout for my test install: (source: mikeschinkel.com) The next … Read more

WordPress Posts By Date/Day?

Not a bad idea for display of a blog home page and I would be interested in what you came up with, but thinking through the idea for implementation beyond the first page would be problematic: Pagination – If it is just the blog home then you can easily set an offset for starting on … Read more

Archive permalinks

The really easy way: Change your permalink structure to include a “front” part. Eg. /news/%postname% The slightly more complicated and inflexible way: WordPress holds it’s data permastruct in a property of the global WP_Rewrite object stored in $wp_rewrite. You can hook in sometime early-ish (around init) and change this. <?php add_action(‘init’, ‘wpse39274_change_date’); function wpse39274_change_date() { … Read more

Proper way of making custom post type landing page or archive page

For this situation, I create a custom page template, say tpl-archive-page.php. For example using Advanced Custom Fields and the Post Type Selector Field(*) the user can choose a post type to connect to. <?php /** * Template Name: CPT Archive Page */ get_header(); while (have_posts()) : the_post(); get_template_part(‘content’, ‘page’); $archive_query_post_type = get_post_meta(get_queried_object_id(), ‘cpt_archive_query_post_type’, true); if( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)