Articles of bloginfo

Proper syntax for simple conditional bloginfo language

I need to do something like this: <?php $bloginfo = get_bloginfo( ‘language’ ); if($bloginfo->en-US){ the_time(‘jS F Y’); }else{ the_time(‘d/m/Y’); }; ?> I cant find the proper way to wrap en-US. Any ideas? Thank you in advance, people.

How do I change the login logo URL and hover title?

I am trying to change the login logo URL and hover title. I am using the code below but return bloginfo(‘url’); and return bloginfo(‘name’); aren’t outputting the desired href and title. I’m also using a child theme if that matters at all. What do I need to use instead of return bloginfo(‘url’); and return bloginfo(‘name’);? […]

php syntax – how to concatenate properly – echo bloginfo('stylesheet_directory)

This is driving me batty. Is my syntax wrong? Why is the first “.” in my img src call throwing out an error? This works if I put a hard link in the img src call, FYI. <a class=”blog-image” href=”<?php the_permalink(); ?>”> <?php if (has_post_thumbnail() ) { the_post_thumbnail(‘medium-size’); } else { echo ‘<img src=”‘ . […]

bloginfo('template_directory') img src

I am lazy loading some images with URLs which are added via custom fields. The lazy load plugin I’m using requires a place-holder image in the src attribute and the actual image in data-original. I need the image height and width as well, so I’ve been using wp_get_attachment_image_src(). My problem is using bloginfo(‘template_directory’) to […]

How do I create a dynamically-updated copyright statement?

I’d like to find an optimized, WP_Query-safe method for generating a dynamically-populated copyright statement for the bottom of my themes. That is to say, I’d like to check the date (by year) of my oldest and newest posts and then output something along the lines of [blog name] &copy; [oldest post year]-[newest post year] [primary […]

Right way to add HTML bloginfo name using a filter

I would like to style parts of bloginfo name from a filter. The only thing I want to do is change the site-title of the blog to include HTML so that I can do individual font-settings on part of the name. I’m using the twentyeleven and wonder how I can do this in a filter. […]

How to use bloginfo( 'template_directory' ) in array

I want to pass bloginfo( ‘template_directory’ ) in an array I tried this but not working. How to write it correctly? <?php get_the_image( array( ‘size’ => ‘full’, ‘default_image’ => bloginfo( “template_directory” ) .’/img/dflt.png’, ‘image_scan’ => true, ‘link_to_post’ => false ) ); ?> get_the_image is a function from Justin Tadlock plugin

get_template_directory_uri() and other URL tags not working in theme

So, I’m trying to add get_template_directory_uri or bloginfo() to my header.php file to create relative paths for the CSS and JS files in the theme. E.g., <link rel=”stylesheet” href=”<?php echo get_template_directory_uri(); ?>/css/style.css”> In theory this should show <link rel=”stylesheet” href=””> Problem is, when I view the <head> tag in source all I see is: <link […]

Filter the blog title displayed in the header

I wanted to filter the blog title displayed in the header to apply different CSS styles to different title parts/words, so I added the below function to my (WP 4.7) Twenty Seventeen child theme’s functions.php and this worked very well. The problem is that this function added the CSS code also to the meta title […]

bloginfo('stylesheet_directory') vs. get_stylesheet_directory_uri() and include('file.php') vs. get_template_part()

In my custom theme I’m using <img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/logo.jpg”/> to load my custom logo. I’m using a custom sidebar for front-page.php and that’s why I used <?php include(‘sidebar-front.php’) ?> to get it. But when I’m using the ‘theme-check’ plugin it’s suggesting to change the following: bloginfo(‘stylesheet_directory’) to get_stylesheet_directory_uri() include() to get_template_part() So, I did […]