Creating archive pages for children categories

Create 2 pages category-news.php & category-video.php & put this code in them. Then customize the markup for both as you like <?php $children = get_categories(‘child_of’=>get_query_var(‘cat’)); $cat = array(get_query_var(‘cat’)); foreach($children as $child) $cat[] = $child->term_id; $catPosts = new WP_Query( array( ‘category__in’ => $cat, ‘posts_per_page’ => 5, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ ) ); while ($catPosts->have_posts()) … Read more

Archiving annual festival site

Personally. I would archive the 2010/etc sites to Pure HTML. This plugin would do the job http://wordpress.org/extend/plugins/static-html-output-plugin/ This WordPress codex post describes another method. With using WordPress in its own Sub Directory and archiving sites: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Pointing_your_home_site.27s_URL_to_a_subdirectory

Custom-post-type-archive: posts sorted/filtered by year?

create a variable to hold the $current_year you’re outputting, and check it against each event’s year, resetting the value when you encounter an event with a different year: $current_year=””; while ( $loop->have_posts() ) : $loop->the_post(); // this is just a simple example of the logic, // you’ll need to extract the year from your date … Read more

Archive dropdown styling not applied

You’re targeting cd-dropdown with a class indicator (the period), the cd-dropdown is an ID and should therefore be targeted with the ID selector (a hashtag). #cd-dropdown > span, #cd-dropdown ul li:nth-last-child(-n+3) span { box-shadow: 0 1px 1px rgba(0,0,0,0.1); }

Category page only displaying the posts from a custom type

Ok I found a solution by following the recommandation of s_ha_dum to use pre_gets_posts. All the following code goes to functions.php 1 Create a new rewrite rule function rewrite_clean() { // my CPTs $types = array(‘projects’, ‘works’); foreach($types as $type) { add_rewrite_rule(‘^’.$type.’/([^/]*)/?$’, ‘index.php?post_type=”.$type.”&term=$matches[1]’,’top’); } } add_action(‘init’, ‘rewrite_clean’); transform the following format ?post_type=projects&term=architecture to the following … Read more

front end publishing not working on front-end page

thanks to @TheDeadMedic, I found the solution. I used reserved terms, and that’s why WordPress interpreted my inputs as query parameters. so for example with my categorys, I had to change my classes in my form : ‘post_category’ => array($_POST[‘cat’]), // Usable for custom taxonomies too by ‘post_category’ => array($_POST[‘my_cat’]), // Usable for custom taxonomies … Read more

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