Correct process for a new Page Template?

A page template defines the full rendered content displayed: header, footer, content – everything. So, at the very least, you’ll need to call get_header() and get_footer(), or manually add the header and footer code to the template. Also, I would recommend using a callback to enqueue your custom stylesheet. You can use the is_page_template() conditional … Read more

Remove navigation from header in custom page template

Use a conditional tag: Codex References: Function Reference (is_page) Function Reference (Conditional Tags) You can specify the landing page by Page ID, Page Title or Page Slug. Here is an example: <?php if ( !is_page( ‘landing-page’ ) ) { wp_nav_menu( array( ‘show_home’ => ‘Home’, ‘container’ => ‘false’, ‘theme_location’ => ‘main’) ); } endif; ?> It … Read more

How to add php to theme to show alt attributes

Try adding these codes to your theme’s function.php file: function isa_add_img_title( $attr, $attachment = null ) { $img_title = trim( strip_tags( $attachment->post_title ) ); $attr[‘title’] = $img_title; $attr[‘alt’] = $img_title; return $attr; } add_filter( ‘wp_get_attachment_image_attributes’,’isa_add_img_title’, 10, 2 );

Custom templates for posts like for pages: page-{id} vs single-{id}

A) Single Post Templates: single-{post-type}-{post-name}.php It’s informative to check out the get_single_template() function. There we find the following template possibilities: “single-{$object->post_type}-{$object->post_name}.php” “single-{$object->post_type}.php” “single.php” In WordPress 4.7 this part will be added: “single-{$object->post_type}-{$name_decoded}.php” So it looks like you forgot the {$object->post_type} part in the template’s name. Example: The single template name for the post with the … Read more

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