Questions tagged [bloginfo]
The bloginfo tag has no usage guidance.
58
questions
-2
votes
1
answer
101
views
How to retrieve blog language without any region (locale) attached?
How can you retrieve the language of a WordPress website, without the added region suffix attached to it? In other words, just get the language, without the entire locale.
E.g. <html lang="en&...
0
votes
2
answers
39
views
Show Site Name on WP login screen
I'm trying to create a generic, re-usable function that shows the site name on the login screen. It works with just static text, but how do I pull in the site name dynamically? Here's what I've tried:
...
0
votes
1
answer
35
views
WP HTML Templates - Any way to get bloginfo() or the path to the theme folder?
So in our new architecture for themes, we want to use Gutenberg themes with html templates.
Problem is, when we need to call anything from the theme folder, we have to use the full URL. So if the ...
0
votes
1
answer
2k
views
I have a background-image in css file but don't show in site.how to fix this prblm. i sent screenshot. thx
lock at the pic dont show the background-image.
i try this but not working.... background-image: url("/assets/Logo.png");
how can i fix this prblm. plz give me the solution. Thx.
0
votes
3
answers
649
views
how can i load svg image with get_template_directory_uri() or bloginfo('template_url')
<img alt="Capital" data-inject-svg src="<?php bloginfo( 'template_url' ); ?>/assets/img/logos/imglogo.svg">
<img alt="Capital" data-inject-svg src="<?php echo ...
0
votes
2
answers
275
views
How can I get blog content from SFTP?
I inherited a site that was compromised (I'm not sure what version of wordpress, the crash happened last summer). I have CLI access, and can SFTP into the server. The only thing I want to get is the ...
1
vote
1
answer
1k
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
3
answers
465
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
4
answers
49
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
1
answer
129
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
1
answer
443
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
1
answer
7k
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
1
answer
276
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
1
answer
775
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
2
answers
1k
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
1
answer
74
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
2
answers
359
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
1
answer
39
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
3
answers
770
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 ...
2
votes
1
answer
1k
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
1
answer
5k
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
2
answers
3k
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
1
answer
187
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
1
answer
318
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
2
answers
937
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
1
answer
276
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
1
answer
171
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 ...
6
votes
2
answers
10k
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
1
answer
131
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
1
answer
38
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
1
answer
526
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
3
answers
2k
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
1
answer
96
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
1
answer
1k
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
1
answer
180
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
3
answers
28k
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
1
answer
542
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
3
answers
7k
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 ...
12
votes
1
answer
4k
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
1
answer
136
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
1
answer
4k
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 ...
16
votes
1
answer
29k
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
1
answer
628
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
1
answer
2k
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
1
answer
752
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
1
answer
1k
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
1
answer
4k
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, ...
3
votes
5
answers
35k
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
1
answer
835
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
2
answers
3k
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('...