كيفية تغيير رابط URL الخاص بالشعار لأي من سمات WordPress؟ (بما في ذلك سمات سفر التكوين)
نشرت: 2020-12-07
في Crunchify ، ننشر فقط البرامج التعليمية عالية الجودة ومقتطفات التعليمات البرمجية التي تعمل فقط دون أي تغييرات.
أطلقنا مؤخرًا خدمات Premium وبدأنا أيضًا في بيع المكونات الإضافية وخدمات المطورين المتميزة.
لقد قمنا مؤخرًا بتغيير موقع Premium الخاص بنا ( https://pro.crunchify.com
) والموضوع المتطابق ليتوافق مع الموقع الرئيسي ( https://crunchify.com
).
أثناء القيام بذلك ، لاحظنا أنه من الأفضل أن يكون لديك عنوان URL لشعار عنوان pro.crunchify.com يشير إلى crunchify.com.
هذا الحل يعمل إذا كان لديك أي من الأسئلة أدناه؟
- كيفية تغيير عنوان URL لصورة الرأس؟
- تغييرات على عنوان URL لشعار Genesis Sample Theme
- كيفية تغيير عنوان URL لصورة الرأس الرئيسية؟
- كيفية تغيير رابط صورة الرأس إلى أي عنوان URL؟
- كيفية تغيير رابط صورة العنوان إلى عنوان URL المخصص؟
- كيفية تغيير عنوان URL للراية القابلة للنقر؟
- في WordPress كيفية ربط صورة الرأس بعنوان URL المخصص؟
كنت أبحث عن الحل لبعض الوقت واتصلت أيضًا بفريق دعم Genesis WP. لكن لم تحصل على حل باستثناء بعض المؤشرات والنصائح.

كما ترى ، لا يوجد حل واضح حصلت عليه من فريق Genesis support
.
بعد ذلك ، كنت لا أزال أبحث عن حل لكيفية تغيير رابط الرأس القابل للنقر في WordPress؟
أخيرًا بعد بعض التجارب والخطأ ، تمكنت من تغيير عنوان URL لشعار الرأس.
هنا رمز:
ما عليك سوى وضعه في ملف function.php الخاص بالثيم الخاص بك ويجب أن تكون جيدًا. في حالتي ، قمت بوضع هذا الرمز في ملف pro.crunchify.com theme's function.php
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
function crunchify_custom_logo_url ( $ crunchify_logo_html ) { $ crunchify_custom_logo_id = get_theme_mod ( 'custom_logo' ) ; // Make sure to replace your updated site URL $ crunchify_new_url = 'https://crunchify.com' ; $ crunchify_logo_html = sprintf ( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>' , esc_url ( $ crunchify_new_url ) , wp_get_attachment_image ( $ crunchify_custom_logo_id , 'full' , false , array ( 'class' = > 'custom-logo' , ) ) ) ; return $ crunchify_logo_html ; } // get_custom_logo: Returns a custom logo, linked to home unless the theme supports removing the link on the home page. add_filter ( 'get_custom_logo' , 'crunchify_custom_logo_url' ) ; |
- يرجى التأكد من تغيير
crunchify_new_url
إلى عنوان URL المطلوب.
كيف تتحقق؟

دعنا نتحقق مما إذا كانت الشفرة أعلاه تعمل ولا تكسر أيًا من متطلبات البيانات الوصفية لهيكل Google؟
ألقِ نظرة وقارن بين علامتي HTML أدناه.
قبل تغيير عنوان URL لشعار رأس WordPress
1 2 3 4 5 |
< div class = "title-area" > < a href = "https://pro.crunchify.com/" class = "custom-logo-link" rel = "home" > < img width = "946" height = "198" src = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" class = "custom-logo" alt = "crunchify-pro-logo-white" srcset = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png 946w, https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white-768x161.png 768w" sizes = "(max-width: 946px) 100vw, 946px" data - attachment - id = "2386" data - permalink = "https://pro.crunchify.com/crunchify-pro-logo-white/" data - orig - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - orig - size = "946,198" data - comments - opened = "1" data - image - meta = "{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data - image - title = "crunchify-pro-logo-white" data - image - description = "" data - medium - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - large - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" > < / a > < p class = "site-title" > Crunchify Pro < / p > < p class = "site-description" > Premium Services , Plugins & Digital Downloads < / p > < / div > |
بعد تغيير عنوان URL لشعار رأس WordPress
1 2 3 4 5 |
< div class = "title-area" > < a href = "https://crunchify.com" class = "custom-logo-link" rel = "home" > < img width = "946" height = "198" src = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" class = "custom-logo" alt = "crunchify-pro-logo-white" loading = "lazy" srcset = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png 946w, https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white-768x161.png 768w" sizes = "(max-width: 946px) 100vw, 946px" data - attachment - id = "2386" data - permalink = "https://pro.crunchify.com/crunchify-pro-logo-white/" data - orig - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - orig - size = "946,198" data - comments - opened = "1" data - image - meta = "{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data - image - title = "crunchify-pro-logo-white" data - image - description = "" data - medium - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - large - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" > < / a > < p class = "site-title" > Crunchify Pro < / p > < p class = "site-description" > Premium Services , Plugins & Digital Downloads < / p > < / div > |
يبدو ترميز البنية جيدًا والفرق الوحيد الذي أراه هو عنوان URL الخاص بالشعار. وهذا كل شيء .

آمل أن يساعدك هذا في تغيير عنوان URL لشعار رأس القالب الخاص بك.
لا تتردد في إخبارنا من خلال التعليق بتعليقاتك وتعليقك.