Custom post type permalink endpoint

A couple things. First, your function names need to be prefixed with something unique. WordPress is a big ecosystem, and someone else has probably used all the generic function names you can think of. Second, add_rewrite_endpoint takes care of adding query variables for you. So you don’t need this: add_filter( ‘query_vars’, ‘add_query_vars’); function add_query_vars($vars){ $vars[] … Read more

WordPress Rewrite Rules for Custom Post Type and Taxonomy

Hope this can solve your problem function my_custom_post_type() { $labels = array( ‘name’ => _x(‘Projects’, ‘post type general name’), ‘singular_name’ => _x(‘Project’, ‘post type singular name’), ‘add_new’ => _x(‘Add New’, ‘project item’), ‘add_new_item’ => __(‘Add New Project’), ‘edit_item’ => __(‘Edit Project’), ‘new_item’ => __(‘New Project’), ‘view_item’ => __(‘View Project’), ‘search_items’ => __(‘Search Projects’), ‘not_found’ => … Read more

Custom rewrite rules for archive page and single post

I found solution! A Monkeyman Rewrite Analyzur plugin was very helpful: https://wordpress.org/plugins/monkeyman-rewrite-analyzer/ So now, I have such working urls… single.php: /magazine-name/issue-year/issue/article-name archive.php: /magazine-name/issue-year/issue /magazine-name/issue-year /magazine-name On a custom post editor page in wp-admin I use Advanced Custom Fields plugin for issue year and issue. You can also define meta fields by yourself. Next I added … Read more

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