Include a specific page in your template

Another great way of accomplishing something like this would be taking advantage of WordPress Custom Post Types. You could set up 3 different types of features for easy use in the WordPress back-end. First, Set up the Custom Post Types To do this, open up your theme’s functions.php file and include something like this: <?php … Read more

How to create a wordpress template without using any page

You may use template_redirect action: add_action( ‘template_redirect’, ‘wpse131387_template_redirect’ ); function wpse131387_template_redirect( ){ if ($_SERVER[‘REQUEST_URI’] == ‘/some-template’) { global $wp_query; $wp_query->is_404 = false; status_header(200); include(dirname(__FILE__) . ‘/some-template.php’); exit(); } }

bloginfo(‘template_directory’) img src

You cannot use bloginfo() while your are outputting using echo because bloginfo it self also out puts string using echo. Below will work for you, you also have extra double quote which i have removed…. <?php $attch_id_1 = pn_get_attachment_id_from_url(get_post_meta($post->ID, ‘img1’, true)); $image_attributes_1 = wp_get_attachment_image_src( $attch_id_1, ‘full’); $attch_id_2 = pn_get_attachment_id_from_url(get_post_meta($post->ID, ‘img2’, true)); $image_attributes_2 = wp_get_attachment_image_src( $attch_id_2, … Read more

Blank space at beginning of tag?

It looks like your site’s title is empty. Fill it out or try for example: add_filter( ‘wp_title’, function( $title ) { return trim( $title ); } ); to remove the blank space in front. For your setup, the following part of wp_title() is responsible for the blank space: $title = $prefix . implode( ” $sep … Read more