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

Strange Behaviour with is_home()

From look at the code the following logic happens in your case: query is for one post type that has archive is_post_type_archive gets set to true is_archive gets set to true is_home gets set to false since it is seen as archive I am not sure about all implications without extensive testing, but probably approaches … Read more

How to display only an excerpt of the content with custom post types?

You only need two small changes (1st and 3rd lines), though I also took the liberty of tweaking the classes on the div to what seemed more appropriate: <h1 class=”title”><a href=”https://wordpress.stackexchange.com/questions/67750/<?php the_permalink(); ?>”><?php the_title(); ?></a></h1> <div class=”excerpt event”> <?php the_excerpt(); ?> <?php wp_link_pages(array(‘before’ => ‘<div class=”page-link”>’.__(‘Pages’, ‘cpotheme’).’:’, ‘after’ => ‘</div>’)); ?> </div>

Template for slug

Try creating a Page with the users slug, then using a custom Page Template to provide the functionality you want to display all the users.

how to create template path for external (include) .js file

Use wp_enqueue_script(), hooked in via an appropriate action hook callback. wp_enqueue_script( // Script handle ‘someScript’, // URL get_template_directory_uri() . ‘/js/someScript.js’, // Dependencies array( ‘jquery’ ), // Version ‘2.4’, // Output in footer? false ); For example: function wpse72720_enqueue_scripts() { if ( ! is_admin() ) { wp_enqueue_script( ‘mathUtils’, get_template_directory_uri() . ‘/js/mathUtils.js’, array(), ”, false ); wp_enqueue_script( … Read more

Child theme template file will not load

This is a basic WordPress question, please get familiar with theme theming concepts. Basic theme: https://codex.wordpress.org/Theme_Development Child themes: https://codex.wordpress.org/Child_Themes Theme hierarchy Parent theme style.css /* Theme Name: Twenty Fifteen Theme URI: https://wordpress.org/themes/twentyfifteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Twenty Fifteen Version: 1.3 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html … Read more

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