Custom Post Type Archive template not being called

Everything you describe is expected behavior based on your post type registration settings. A page isn’t going to load an archive template, I’m not sure why you’d expect it to. Your rewrite argument slug is only for single posts. Setting has_archive to true uses the post type slug as archive location, which is ttwi_course. If … Read more

CPT with its own category and tag url

First, we need to declare CPT. Here in example I am creating with the name “command“. Also I am adding category and tag support for this CPT. The CPT will be public, searchable, will have archive page, feed page etc. add_action( ‘init’, ‘create_post_type’ ); function create_post_type() { $post_array = array( ‘name’ => __( ‘Command’ ), … Read more

Do shortcode in template file

I think you need to escape the quotes: <?php echo do_shortcode(‘[gfchartsreports include=”28″ type=”bar” chart_js_options=”title: {display: true, text: \’Titletext\’, fontSize:12,fontFamily:\’Arial\’,fontColor:”#000″,fontStyle:”bold”,padding:20}” custom_search_criteria=\'{“status”:”active”,”field_filters”:{“0”:{“key”:”created_by”,”value”:”current”}}}\’]’); ?>

How to add html code at the bottom of the post in archive page?

Open archive.php from your theme’s directory the code will look like this <?php /* Template Name: Archives */ get_header(); ?> <div id=”container”> <div id=”content” role=”main”> <?php the_post(); ?> <h1 class=”entry-title”><?php the_title(); ?></h1> <?php get_search_form(); ?> <h2>Archives by Month:</h2> <ul> <?php wp_get_archives(‘type=monthly’); ?> </ul> <h2>Archives by Subject:</h2> <ul> <?php wp_list_categories(); ?> </ul> </div><!– #content –> </div><!– … Read more

How to get posts by category at /%category%/ url?

Is the archive.php correct template for that? archive.php is the most common file to load any kind of archive posts. But anytime the user loads a category archive page, WordPress template system looks for files in this order: category-slug.php → category-id.php → category.php → archive.php → index.php If you want to create a specific template … Read more

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