add_action('add_meta_boxes', function() {
add_meta_box(
'custom-logo-metabox',
'Custom Logo',
function($post) {
// Add a nonce field so we can check for it later
wp_nonce_field('custom_logo_meta_box', 'custom_logo_meta_box_nonce');
// Retrieve the existing value from the database
$custom_logo_id = get_post_meta($post->ID, '_custom_logo_id', true);
$custom_logo_url = $custom_logo_id ? wp_get_attachment_image_url($custom_logo_id, 'thumbnail') : '';
// Output the form fields
echo '
';
echo '';
echo '';
echo '';
echo '';
echo '
';
// Add a script to handle the media uploader
?>
';
}
}
}
return $html;
});
add_filter('get_site_icon_url', function($url, $size, $blog_id) {
if (is_page()) {
// Get the current page's ID
$post_id = get_the_ID();
// Retrieve the custom logo URL from post meta
$custom_logo_id = get_post_meta($post_id, '_custom_logo_id', true);
if ($custom_logo_id) {
$custom_logo_url = wp_get_attachment_image_url($custom_logo_id, array($size, $size));
if ($custom_logo_url) {
return $custom_logo_url;
}
}
}
return $url;
}, 10, 3);
Zum Inhalt springen
Wir verwenden Cookies, um Ihre Erfahrung auf unserer Website zu verbessern. Durch die Nutzung unserer Website stimmen Sie der Verwendung von Cookies zu.
Nous utilisons des cookies pour améliorer votre expérience sur notre site. En utilisant notre site, vous consentez à l'utilisation des cookies.
Diese Website verwendet Cookies. / Ce site utilise des cookies.
Websites speichern Cookies, um die Funktionalität zu verbessern und Ihre Erfahrung zu personalisieren. Sie können Ihre Präferenzen verwalten, aber das Blockieren einiger Cookies kann die Leistung und Dienste der Website beeinträchtigen.
Les sites web stockent des cookies pour améliorer les fonctionnalités et personnaliser votre expérience. Vous pouvez gérer vos préférences, mais le blocage de certains cookies peut affecter les performances du site et les services proposés.
Essential cookies enable basic functions and are necessary for the proper function of the website.
Name
Beschreibung / Description
Dauer / Durée
Cookie Preferences
This cookie is used to store the user's cookie consent preferences.
30 days
These cookies are needed for adding comments on this website.
Name
Beschreibung / Description
Dauer / Durée
comment_author
Used to track the user across multiple sessions.
Session
comment_author_email
Used to track the user across multiple sessions.
Session
comment_author_url
Used to track the user across multiple sessions.
Session
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
SourceBuster is used by WooCommerce for order attribution based on user source.
Name
Beschreibung / Description
Dauer / Durée
sbjs_current_add
Timestamp, referring URL, and entry page for your visitor’s current visit to your store
session
sbjs_migrations
Technical data to help with migrations between different versions of the tracking feature
session
sbjs_session
The number of page views in this session and the current page path
30 minutes
sbjs_udata
Information about the visitor’s user agent, such as IP, the browser, and the device type
session
sbjs_first
Traffic origin information for the visitor’s first visit to your store (only applicable if the visitor returns before the session expires)
session
sbjs_current
Traffic origin information for the visitor’s current visit to your store
session
sbjs_first_add
Timestamp, referring URL, and entry page for your visitor’s first visit to your store (only applicable if the visitor returns before the session expires)
session
Marketing cookies are used to follow visitors to websites. The intention is to show ads that are relevant and engaging to the individual user.