Categories in custom post types

If you want to use builtin WordPress categories, while calling register_post_type function with taxonomies parameter set to category If you want to create a custom category, then use register_taxonomy function to register a brand new taxonomy with second parameter to be your custom post type name and pass it taxonomy name to register_post_type as explained … Read more

WordPress archive posts returns user to homepage

are you using archives widget? if not then which function you are calling to get archives. try to add this code (below) in your sidebar. <?php $archives = wp_get_archives(‘type=monthly&limit=10&echo=0’); if ($archives) { ?> <ul class=”archive-list”> <?php echo $archives; ?> </ul> <?php } ?> this will output as an unordered list of last 10 monthly archives, … Read more

WordPress archives by custom field and date

This will get the posts filtered by custom field and its value based on categories. $args = array( ‘post_type’=>’post’, ‘category__in’=> array(6, 7, 31), //category id ‘meta_key’=>’keys’, // customfield name ‘meta_value’=>5, // customfield value ‘posts_per_page’=>-1, ‘number_posts’=>-1 ); $s = get_posts($args); foreach($s as $e ) { echo $e->ID.'<br/>’; echo $e->post_title.'<br/>’; }

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

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