get_bloginfo prints IP instead of url
Use Database Search and Replace and replace the IP 192.168.33.21 with the domain name project.dev.
Use Database Search and Replace and replace the IP 192.168.33.21 with the domain name project.dev.
The conditional tag is_front_page() is used to specifically check for a static front page, so you should be able to use that to switch between your title formats <title> <?php if(is_front_page()) { bloginfo(‘name’); } else { wp_title( ‘|’, true, ‘right’ ); }; ?> </title>
I assume you’re wanting an image tag in there too: if ( $colors && in_array( ‘green’, $colors ) ) { echo ‘<div class=”asdsf”><img src=”‘; echo bloginfo(‘template_directory’) . ‘/path/within/theme/to/img.png’; echo ‘”></div>’; } But it’s better to use the newer get_stylesheet_directory_uri() which will work whether or not you are using a child theme. if ( $colors && … Read more
Figured it out! function split_title($title) { $title = get_bloginfo(‘name’); $word = substr($title, 0 , 5); $press = substr($title, 5); $html = “{$word}<span class=”bold”>{$press}</span>”; return $html; } And then <?php echo split_title($title); ?>
At the time of writing this isn’t possible, twentytwentytwo works around this by registering patterns in a subfolder then using a pattern block. This way they can define patterns in PHP then use the functions. This is how they show the bird in the header and include localised strings.
The error indicates that your file “floater.php” is being called outside of a WordPress generated page. Add this to the top of the file to be able to use WordPress functions. EDIT: See Brian Fegter response on using the server path for your include. if ( !function_exists( ‘get_bloginfo’ ) ) require( ‘../../../wp-blog-header.php’ ); // check … Read more
try this ‘href’=> admin_url(“post-new.php?post_type=albertis-kunstwerke”)
You will need to use site_url($path_to_style_sheet, ‘https’) instead of bloginfo(). The home_url() method also supports https.
Starting from WordPress 4.7, I would use get_theme_file_uri(), so any child theme can override the file easily: if the file exists in the child theme, get_theme_file_uri() returns the URI to that file, otherwise returns the file in the parent theme: wp_enqueue_script( ‘localScroll’, get_theme_file_uri( ‘js/jquery.localScroll.min.js’ ), array( ‘scrollTo’ ), ‘1.2.8b’, true ); If you want to … Read more
Generally, they will return the same URL, as bloginfo( ‘url’ ) will call home_url internally with any arguments, and the default first argument ($path) of home_url is the empty string. However, bloginfo( ‘url’ ) will apply an additional filter to it, namely the home_url filter. Common pratice is to use home_url, indeed with esc_url (even … Read more