Create Page with Template File from Plugin Folder

It is probably wp_insert_post can’t recognize your template. You need to include it in the list of the templates. function wpse410645_add_plugin_template( $page_templates ) { $page_templates[plugin_dir_path( __FILE__ ) . ‘/templates/mytemplate.php] = ‘My Template Name’; return $page_templates; } add_filter( ‘theme_page_templates’, ‘wpse410645_add_plugin_template’ );

Adding custom theme template to custom post type [duplicate]

File should be single-member_post.php instead of single-memberPost.php. In single-{posttype} , {post_type} is the $post_type argument of the register_post_type() function. Never use flush_rewrite_rules(); in init use it only on theme/plugin deactivate or activate. Since this is a theme you can use it on after_switch_theme hook. add_action( ‘init’, ‘my_cpt_init’ ); function register_cpt_member_post() { register_post_type( … ); } … Read more

html blog template to wordpress template

That is a much bigger topic than can be addressed here. Please take a look at the WordPress Codex entry on Theme Development Generally speaking, you break the HTML into a header, footer, and content area. The header goes into header.php, the footer goes into footer.php and the content area goes into index.php or another, … Read more

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