Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

logo

Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme

Use wp_get_attachment_image_src to get the image properties and URL: $logo = get_theme_mod( ‘custom_logo’ ); $image = wp_get_attachment_image_src( $logo , ‘full’ ); $image_url = $image[0]; $image_width = $image[1]; $image_height = $image[2]; Edit: Adding more information based on your comment. The URL it points to is simply made with home_url: esc_url( home_url( “https://wordpress.stackexchange.com/” ) ); Another thing … Read more

Categories PHP Tags functions, logo, php, theme-development

Remove Site Logo from Homepage in Twenty Twentyone

I had a quick look at the site-branding template part which handles the rendering of the custom logo on the site header. There’s a conditional check on two lines against has_custom_logo(), along show title theme mod, which determines, if the custom logo should be rendered or not. Internally has_custom_logo() calls get_theme_mod( ‘custom_logo’ ) to figure … Read more

Categories logo Tags logo, theme-twenty-twenty-one

Custom logo sizes for multiple logos

It’s possible to modify the size of the custom logo with: // Modify the custom logo size add_filter( ‘image_downsize’, ‘wpse241257_new_custom_logo_size’, 10, 3 ); // Display the custom logo the_custom_logo(); where our filter callback is defined as (PHP 5.4+): function wpse241257_new_custom_logo_size( $downsize, $id, $size ) { //——————- // Edit to your needs $size = [80,80]; // … Read more

Categories functions Tags functions, logo

Change logo on each page of University Hub theme [closed]

I would add a filter to the body class in your functions.php file. This will add a class based on the page/post/cpt slug: PHP: /** * * Add Page/Post Body Class Slug * * post-slug-for-post * page-slug-for-page * * */ function yourprefix_page_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] … Read more

Categories themes Tags child-theme, css, logo, themes

Changing itemprop from logo to image on custom logo?

I assume you have problem with google validator about itemprop=”logo”. You can hook into the get_custom_header filter and alter the HTML structure: add_filter( ‘get_custom_logo’, ‘my_custom_logo’ ); // Filter the output of logo to fix Googles Error about itemprop logo function my_custom_logo() { $custom_logo_id = get_theme_mod( ‘custom_logo’ ); $html = sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/269388/%1$s” class=”custom-logo-link” rel=”home” itemprop=”url”>%2$s</a>’, … Read more

Categories functions Tags functions, logo, theme-development

Display a default image for custom-logo

When you display the custom logo you can check if is set, if not you display another image. You can achieve this with the following code featured in the documentation. I adapted it to suit your needs: $custom_logo_id = get_theme_mod( ‘custom_logo’ ); $logo = wp_get_attachment_image_src( $custom_logo_id , ‘full’ ); if ( has_custom_logo() ) { echo … Read more

Categories customization Tags customization, genesis-theme-framework, logo

WordPress login page logo customization

get_stylesheet_directory_uri() is a PHP function, you must use it in a PHP file instead of your CSS file. In your functions.php you can paste this code and change depends on your needs: function my_login_logo() { ?> <style type=”text/css”> body.login div#login h1 a { background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/Logo-B-Classic.jpg); } </style> <?php } add_action( ‘login_enqueue_scripts’, ‘my_login_logo’ … Read more

Categories images Tags images, login, logo, paths

Changing Login Logo

If you are using a child theme then maybe you should try the following code. Not necessary to put !important too unless some other plugin or code is overwriting it. function custom_loginlogo() { echo ‘<style type=”text/css”> h1 a { background-image: url(‘. get_stylesheet_directory_uri().’/images/login_logo.png); } </style>’; } add_action(‘login_head’, ‘custom_loginlogo’);

Categories login Tags login, logo

What flex-width/height does?

flex-width stands for flexible width and flex-height stands for flexible height <?php // Previous function code here $args = array( ‘default-image’ => get_template_directory_uri() . ‘/assets/images/default-image.jpg’, ‘default-text-color’ => ‘000’, ‘width’ => 1140, ‘height’ => 250, ‘flex-width’ => false, // Now width are fixed to 1140 px ‘flex-height’ => true, // Height is adjustable ); // Later … Read more

Categories theme-development Tags add-theme-support, logo, theme-development

Replace admin bar logo

That’s controlled by a Dashicon (font icon) and a before statement: #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before { content: ‘\f120′; top: 2px; } What you’d want is to replace the content call. Use a built in Dashicon from here: http://melchoyce.github.io/dashicons/ So the smilie would be content: ‘\f328;`

Categories admin-bar Tags admin-bar, logo
Older posts
Newer posts
← Previous Page1 … Page10 Page11 Page12 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress