Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bloginfo]

The tag has no usage guidance.

0
votes
1answer
133 views

How can I use get_bloginfo('admin_email') in a custom PHP file?

How can I use get_bloginfo('admin_email') in a custom PHP file located in the parent theme root directory? I've built a custom form and a PHP mail script separately, but now I'd like to send the form ...
0
votes
3answers
117 views

What is the difference between the different ways of linking stylesheets

I'm only just learning WP theme development so this may be a very stupid question, but I have noticed there are different ways to link to the main stylesheet from the index.php: <?php bloginfo('...
1
vote
4answers
45 views

Still relevant method of embedding images in WP Theme in 2018

<img src="<?php echo get_bloginfo('template_url') ?>/images/logo.png"/> Is the above still a relevant method of embedding images in the Wordpress theme or an obsolete? If obsolete then ...
0
votes
1answer
45 views

How can I change the background color of a contact box? [closed]

I want to change the background color of this example contact-box but I haven't been able to do so.
0
votes
1answer
287 views

Form action unfamiliar

I am refactoring some code in the header.php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://...
0
votes
1answer
2k views

How to add dynamic content in title and meta description in wordpress theme for homepage, post page, category, tag and pages

I am creating wordpress theme and want to get and display dynamic content for my theme Title Tag and Meta Description Tag. For Title Tag Content: I want Title For Meta Description: I want Bloginfo('...
0
votes
1answer
94 views

Split site title and apply different classes

I'm currently designing a theme using Underscores and I want to do something like this with the site's title: Thisisthetitle So the title is all one word and the last five characters are different ...
1
vote
1answer
202 views

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" ...
0
votes
2answers
462 views

Should I use get_bloginfo('stylesheet_directory') or get_stylesheet_directory_uri() when enqueueing my js files?

I am using a Genesis theme (digital-pro), and inside of the front-page.php file (companion to functions.php) I am noticing that js files are enqueued in two different ways. Example 1: ...
0
votes
1answer
51 views

Filter the blog's title without using global variables

The below code uses the bloginfo filter to add some CSS rules to my blog’s title and outputs it to the site header, without affecting the HTML head’s <title> tag. This solution was taken from ...
2
votes
2answers
180 views

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 ...
0
votes
1answer
30 views

Using bloginfo and divs inside a php file

The following code is inside a .php file and works; however, I do not know how I can replace the TEXT with a bloginfo('template_directory') to an internal image file. I've search the forums but I ...
4
votes
3answers
310 views

Is there a blog info object?

The functions get_bloginfo() and bloginfo() both return information about the blog but accessing it each time seems unnecessary. Is there a function that will return the bloginfo as an object with ...
1
vote
1answer
846 views

Is it possible to change the template_directory?

I've created a site on a localhost that is going to be migrated to a ssl server, with the scripts, css, images all coming from a CDN. To call files in the site i'm using bloginfo('template_directory')...
0
votes
1answer
2k views

Change the meta description on a specific page?

I want to change the title and meta description on my homepage if it's opened on an android phone. I have this code that changes the title, inside functions.php: /** Modify the front/home page ...
0
votes
2answers
2k views

Correct way to hardcode an image into a parent theme file?

I wanted to ask if ths is the best practice for calling an image into a parent theme file by using bloginfo('template_directory')? <img src="<?php bloginfo('template_directory'); ?>/img/logo....
0
votes
1answer
160 views

Custom Info Box at end of posts?

I'm pretty new to WordPress so there are some parts of it I have difficulty working with. I run a small scale gaming niche website which focuses on just a small group of video games, and what I'm ...
1
vote
1answer
144 views

Change “en-US” to “en”

Hey I am trying to edit the WP theme files, and I am using bloginfo('language') to get the language of the page. However, it returns me "en-US", which does not work while redirect the page. The site ...
0
votes
2answers
699 views

Need help with page title (Static front page)

I need some help with the code to put inside the <title> to generate the following: Static front page: Should just be the bloginfo('name') All other pages: Should be wp_title() | bloginfo('name'...
0
votes
1answer
234 views

Wordpress address URL and bloginfo

I have updated my Wordpress Address (URL) and Site Address (URL) to be https:// in the General Settings of Wordpress as I have added a secruity certificate to the hosting. Should the css url ...
0
votes
1answer
141 views

get_bloginfo prints IP instead of url

I just recently moved a site to another production environment and I seem to have missed some setting in the db config as a lot of the built-in functions prints the IP instead of the url. Ideas? Tried ...
3
votes
2answers
5k views

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 ...
0
votes
1answer
90 views

Access from template info of another blog (in the same network)

In my root blog (1), i have a custom post type that can be linked to an existing blog of my network. It does so by recording in post metas the ID of the blog it is linked to. I use _blog_id as a name ...
0
votes
1answer
33 views

How can I include a file related to blog URL? Nothing seems to work

When I was building my website locally using WAMP, I was just using simple include '/extras/file.php'; Of course, that would start at the root folder, and look in the extras folder. However, now I'm ...
0
votes
1answer
419 views

How to call for bloginfo inside function in functions.php?

I am new to WordPress and PHP, so I have this question: I want to add a Link to the "New Post" for a Custom Post Type I implemented. But it will only let me put static links, connected to my ...
4
votes
3answers
919 views

bloginfo() vs get_option?

What's the difference between: bloginfo('name'); vs get_option('blogname'); The parameter is just an example, but I see no differences in terms displaying what I want. Are there any particular ...
0
votes
1answer
79 views

Blogname and Blogdescription in Pagelines DMS Options Panel

I am attempting up set up a front end options panel in the pagelines-dms framework, from which users will be able to change the blogname and blogdescription. So far I have set up the form which has ...
0
votes
1answer
957 views

How to set base url for php widget

SO, I have some php that I'm inserting into a widget that generates a list of pdfs within a directory on the root level of my wordpress install (see "Meeting Summaries" to the right here: http://mt-...
0
votes
1answer
72 views

How to make title for home to be News, but if page has parent then its name else just post/page name

Made own template from scratch and tutorials. This is showing description of post/page Title and in home its showing website name. <h3><?php is_home() ? bloginfo('description') : wp_title('')...
1
vote
3answers
20k views

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. ...
0
votes
1answer
428 views

Bloginfo hook - can it be more precise?

From the codex, regarding filter hooks: bloginfo_url applied to the the output of bloginfo("url"), bloginfo("directory") and bloginfo("home") before returning the information. Is there a way I can ...
4
votes
3answers
6k views

Difference between bloginfo('home') and home_url() and site_url()

I have been reading through Codex and other SO and SE posts regarding this. But I am confused. I used home_url() and site_url() to linking the site's home and it gave same results. As I was using ...
10
votes
1answer
3k views

From a security standpoint, should bloginfo() or get_bloginfo() be escaped?

I've been reviewing a lot of information about WP theme and plugin security and understand the concept that you should escape attributes and HTML values in themes and plugins. I've seen bloginfo() and ...
-1
votes
1answer
127 views

WPMU - How to echo only one URL

I have this code that I am using on a site to check if the current user has a blog on the our wp network and as of now it is echoing the URL for both the main site and their blog. I would like to know,...
3
votes
1answer
3k views

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 ...
14
votes
1answer
27k views

get_template_directory() vs bloginfo( 'template_directory' ) vs TEMPLATEPATH

I was reading this article: Common WordPress Development Mistakes and How to Fix Them, and in it, they author says: Getting the theme location: If you are using TEMPLATEPATH or bloginfo( '...
2
votes
1answer
542 views

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'...
0
votes
1answer
1k views

Wordpress function bloginfo not echoing output on parts of the pages

I'm having a bit of a problem with the bloginfo() function in Wordpress which I've never had before. Normally I use <?php bloginfo('template_directory'); ?>/rest of image link here but for ...
1
vote
1answer
635 views

Access bloginfo, get_option, and plugins_url from a non-core php file

I am creating a plugin that has a php file in the plugin directory which is accessed directly via a custom rewrite url. I need this file to be able to use the three functions mentioned in the title. ...
1
vote
1answer
967 views

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 ...
0
votes
1answer
3k views

CSS images don't show up with bloginfo

I'm new to WP and PHP and I'm trying to convert my 'old' HTML theme into a WP theme. I created my index.php page and linked it to the style.css. I have some images in the css and, from what I've read, ...
2
votes
5answers
25k views

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="<?...
2
votes
1answer
637 views

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 ...
0
votes
2answers
2k views

Wp Enviroment problem with included file

i have a file i am including across site to index.php, single.php etc. This file behaves really strage and acts like it not part of wordpress Enviroment meaning: i get errors on get_bloginfo('...
1
vote
1answer
97 views

sprintf bloginfo odditie

Why the disco funk this is happening I can't quite put my finger on - but I guarantee you it's because I'm probably missing some simple PHP best-practice: <?php echo '<h3>' . sprintf(__('...
0
votes
2answers
3k views

if not empty bloginfo('description')

Can someone tell, how to check whether it's empty? <?php bloginfo('description'); ?> Something like: <?php if (!empty bloginfo('description');) ?> Thanks a lot.
0
votes
4answers
4k views

How to use tinyMCE for user “biographical info” without messing with any core file?

I noticed when you typein the user's “biographical info” on the profile, it shows up in one page! Looks really terrible. So: Is there a way to use tinyMCE or other solution for user “biographical ...
0
votes
1answer
167 views

Header Link function not working. Problem with bloginfo()

I'm writing a function to make all of my header images link to their respective home pages. I wrote this function: function get_category_location(){ $header = get_category_header(); $...
0
votes
1answer
51 views

Inconsistent bloginfo information

I'm doing a little bit of work on a theme I just inherited from another developer. The site just broke, and I'm trying to fix it. You can see the site here: www.bowlingventures.com What's happening ...
0
votes
2answers
409 views

Are get_bloginfo queries cached to start, or should they be cached?

I was just wondering if calling get_bloginfo too many times was going to harm performance in a theme and if the data should just be put into its own var?