Need help with page title (Static front page)

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>

Using bloginfo and divs inside a php file

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

Split site title and apply different classes

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); ?>

Wp Enviroment problem with included file

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

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

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

Form action unfamiliar

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