אחד הדברים החשובים באתרי תוכן הוא לעודד את הגולשים לשתף את התוכן עם חברים. במדריך הזה נראה איך אפשר לעשות באלמנטור שדה שמאפשר לגולשים להעתיק בקלות את הURL של העמוד לclipboard שלהם.
כי למי יש זמן ב2021 ללחוץ על CTRL+C? בטוח לא לגולשים שלכם 😎

שלב 1 – הוספת טופס אלמנטור
אוקיי אז במקרה שלי אני רוצה להוסיף את השדה URL לכל הפוסטים באתר למטה.
מה שאני עושה זה נכנס לעריכת הסינגל פוסט באלמנטור ומוסיף וידג׳ט טופס של אלמנטור.
נמחק את כל השדות ונשאיר רק שדה טקסט אחד, בנוסף לזה נשנה את התווית למצב ״הסתר״ כמו בתמונה.
בשדה שהשארנו נמחק את הטקסט פנימי ונשנה את התווית לURL.
בלשונית ״מתקדם״ נשנה את הID לurl
ועכשיו בערך ברירת מחדל אנחנו רוצים בעצם להציג את הURL של העמוד.
לצערי (עד כמה שידוע לי) לא קיימת דרך מובנית באלמנטור להחזיר את כתובת הפוסט הנוכחי דרך ה״תוכן דינמי״
אז איך אנחנו פותרים את זה? בואו נראה 👇
שלב 2 – קוד PHP שמחזיר את כתובת העמוד הנוכחי
כדי להציג את הURL של הפוסט הנוכחי אנחנו צריכים קוד PHP קצר שמייצר שורטקוד שעושה בדיוק את זה.
את הקוד אני מוסיף לקובץ הfunctions.php בוורדפרס (דרך הפאנל ניהול וורדפרס > עיצוב > עריכת תבנית > בוחר בfunctions.php)
* שימו לב: עריכת קובץ functions.php בצורה הזאת עלולה אם יש טעות בקוד לגרום לנפילת כל האתר כולל הפאנל וורדפרס. לפני שעושים זאת מומלץ לוודא שיש לכם גישה ישירה לשרת במקרה של תקלה. כמו כן, אני לא ממליץ לעשות שינויים כאלה באתר חי.
הקוד PHP:
add_shortcode ('LMN_geturl', 'get_current_page_url');
function get_current_page_url() {
$pageURL = 'http';
if( isset($_SERVER["HTTPS"]) ) {
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return urldecode($pageURL);
}Code language: PHP (php)
שלב 3 – הגדרות נוספות לטופס שלנו
עכשיו כשיש לנו שורטקוד שמחזיר את הURL של העמוד, אפשר להוסיף אותו לשדה בטופס שלנו.
ב״ערך ברירת מחדל״ נלחץ על האייקון של התוכן דינמי ונבחר ״שורטקוד״
עכשיו נכניס את השורטקוד: [LMN_geturl]
אם עשינו הכל נכון, אנחנו אמורים להיות פחות או יותר במצב הזה כרגע:
כלומר: יש לנו טופס עם שדה אחד ובתוך השדה הכתובת של העמוד הנוכחי (הצילום הוא מתוך העריכת אלמנטור אז זה בסדר שזאת הכתובת בשלב הזה).
עכשיו נערוך קצת את העיצוב של הטופס שלנו ונבטל את הכפתור שליחה.
קוד CSS לטופס
selector input {
direction: ltr;
}
selector input:focus {
box-shadow: none;
}
#form-btn {
display: none;
}
selector, selector input {
cursor: pointer !important;
}Code language: CSS (css)
בנוסף, ב״סגנון״ אפשר לשנות את הריווח בין עמודות ושורת ל-0.
ביטול כפתור שליחה
ב״תוכן״ > כפתורים״ נוסיף את הID של הכפתור: form-btn
ונבטל את כל הפעולות אחרי שליחה
שלב 4 – הוספת טקסט לחיץ ״העתקת קישור״
מתחת לטופס שיצרנו נוסיף וידג׳ט כותרת.
ב״תוכן״ נרשום בכותרת ״העתקת קישור״ (או טקסט אחר לבחירתנו)
ונשנה בHTML ל: span
ב״מתקדם״ ניתן Z-index של 9
ונכניס CSS ID:
copy-btn
ובCSS מותאם של הוידג׳ט הזה נכניס את הקוד הבא:
selector {
cursor: pointer;
}
selector span {
transition: 0.2s;
}
selector:hover span {
color: #000 !important;
}Code language: CSS (css)
עכשיו נמקם את הטקסט בתוך השדה שמעליו.
בשביל לעשות את זה נעבור ל״מתקדם״ > ״מיקום״
נבחר רוחב ״בתוך השורה״
ובמיקום נבחר ״מוחלט״ ונזיז את האוריינטציה בהתאם.
טיפ: אם השדה שאתם יוצרים לא נמצא בסוף או בתחילת עמודה יהיה לכם בעייתי למקם את הטקסט עם מיקום מוחלט. מה שאפשר לעשות זה להכניס אזור פינמי עם עמודה אחת ולהכניס לאזור הזה את הטופס + הטקסט שיצרנו. ככה מיקום הטקסט יהיה יחסי לאזור הפנימי ולכן יהיה נוח יותר לשימוש גם ברספונסיביות.
השדה URL שלנו אמור להראות בשלב הזה בערך ככה:
עכשיו נשאר לנו משהו ממש קטן וזניח להוסיף… את הפונקצינליות של העתקת הטקסט 🙂
שלב 5 – קוד JS להעתקת הטקסט בלחיצה
כמעט סיימנו!
נשאר רק להוסיף וידג׳ט HTML ולהדביק שם את הקוד הבא:
<script>
function UrlFromInput() {
var copyText = document.getElementById("form-field-url");
copyText.select();
copyText.setSelectionRange(0, 99999);
document.execCommand("copy");
document.querySelector("#copy-btn span").innerHTML = "הועתק ללוח!";
}
document.getElementById("copy-btn").addEventListener("click", UrlFromInput);
document.getElementById("form-field-url").addEventListener("click", UrlFromInput);
</script>Code language: HTML, XML (xml)
והתוצאה…

מה שנשאר לכם לעשות עכשיו זה ללחוץ על הכפתור ״העתקת קישור״ שנמצא ממש כאן למטה ולשלוח לחברים וקולגות שאולי המדריך רלוונטי גם אליהם 🙂


15 תגובות
מעולה! תודה!
❤️
הי כפיר.
תודה ממש .
אני עוקבת אחרי הפוסטים ומיישמת🥳.
רציתי לשאול בכללי, האם כדאי תמיד להשתמש בתבנית בת?
או שלא תמיד….
ממליץ להתשמש תמיד בתבנית בת, זה יכול לחסוך כאב ראש במקרה של עדכון התבנית הרגילה
אשמח לדעת באמת מהי תבנית בת
היי חיים, תודה רבה על מדריך מעולה!
עקבתי אחרי המדריך באדיקות, וזה לא עובד לי משום מה. אני מקבל שגיאה בקונסול:
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
מה פספסתי?
מי זה חיים? 🤔
דבר איתי בפייסבוק אנסה לעזור 😉
Kfir Bakish
חח דיברתי בדיוק לפני ההודעה עם חיים 🤦♂️
איתך בפייסבוק. תודה!
שלום לכולם!
Hello all!
Hello.
Hello!
אפשר לדלג על כל השלב של הוספת הPHP על ידי שימוש במזהה ID של הפוסט, והוספה של ערך לפניו "the-url-website.com/?p="
זה משמש קיצור אוטומטי לדף הנוכחי
In recent years, cross-border communication has become more frequent than ever before. People from different countries are connecting more frequently for business, travel, education, and social purposes. Despite this progress, linguistic differences still present a major obstacle.
Traditional translation methods such as mobile apps or handheld devices frequently interrupt conversations. As a result, a growing number of people are increasingly adopting AI-powered translation earbuds for seamless communication.
Such advanced earbuds utilize advanced algorithms and neural networks to enable smooth cross-language conversations. Without the need to hold a device, people can speak freely while the system translates spoken language in real time.
A key benefit of this technology is hands-free functionality. Unlike smartphones, they enable natural body language, making conversations feel more human and engaging. This feature is especially valuable when real-time response is essential.
Another important aspect of modern translation earbuds is multilingual compatibility. Many devices are capable of handling multiple dialects, which makes them ideal in diverse linguistic settings worldwide. Some systems are trained on diverse language datasets, reducing misunderstanding.
Accuracy is another factor. Today’s AI-powered devices are powered by machine learning technology to provide translations that sound more human. Compared to earlier translation tools, they benefit from ongoing updates, producing more reliable translations.
These smart devices are increasingly adopted in business settings. Cross-border negotiations commonly require translation support. With AI translation earbuds, collaboration improves significantly. Such innovation helps reduce misunderstandings.
Travelers also benefit greatly on intelligent earbud translators. From airports and hotels, communication challenges often arise. By wearing translation earbuds, people can communicate more comfortably abroad. As a result, this creates a more enjoyable journey.
A growing application for AI translation earbuds is personal language development. Users can observe pronunciation and structure, helping them understand context and usage. Over time, this can improve listening skills.
User comfort and privacy are key factors. Modern AI translation earbuds focus on comfort and usability. Some systems include noise-canceling features, supporting clear communication. Additionally, users can hear translations without external speakers, which is ideal for sensitive conversations.
With ongoing improvements in AI, smart translation devices will continue to improve. Future developments may include faster processing, offline translation, and broader language support. These advancements will further reduce language barriers.
To summarize, smart translation earbuds offer a practical solution in global interaction. Through hands-free multilingual support, users can communicate more freely. With increasing global demand, AI translation earbuds are set to play a vital role across international environments.
https://forum.issabel.org/u/yewemery7
Over the past few years, international interaction has grown at an unprecedented pace. Users across the globe are connecting more frequently across work, leisure, and academic environments. Despite this progress, language barriers still present a persistent problem.
Traditional translation methods like text-based translation software frequently interrupt conversations. As a result, a growing number of people are showing strong interest in AI translation earbuds for seamless communication.
AI translation earbuds integrate AI technology with real-time speech processing to deliver instant language translation. Without the need to hold a device, users can communicate naturally with translations delivered directly into the ear.
A key benefit of AI translation earbuds lies in their ease of use. Compared to mobile apps, these earbuds allow users to maintain eye contact, improving overall interaction quality. This benefit is especially valuable during face-to-face conversations, negotiations, or casual chats.
Another key feature of AI translation earbuds is their support for multiple languages. Most modern models support dozens of languages and accents, making them suitable in diverse linguistic settings worldwide. Certain models are trained on diverse language datasets, reducing misunderstanding.
Precision also plays a crucial role. Today’s AI-powered devices use continuously improving AI models to better capture the meaning of conversations. Compared to earlier translation tools, these solutions improve over time, resulting in better performance.
These smart devices have found applications in the workplace. Global conferences frequently include multilingual teams. By using real-time translation earbuds, collaboration improves significantly. These tools enhances clarity and productivity.
Travelers also benefit greatly on intelligent earbud translators. From airports and hotels, language differences can cause confusion. By wearing translation earbuds, travelers can navigate foreign environments with confidence. As a result, this creates greater independence and convenience.
Another emerging use case for this technology is educational support. Students can compare spoken languages instantly, helping them understand context and usage. Over time, this can improve listening skills.
User comfort and privacy play a significant role. Advanced earbud designs focus on comfort and usability. Advanced versions offer noise reduction and clear audio output, enhancing the listening experience. Additionally, translations are delivered privately through the earbuds, adding an extra layer of privacy.
As artificial intelligence advances, AI translation earbuds will continue to improve. Next-generation features could offer improved accuracy and reduced latency. These advancements will make global communication easier.
In conclusion, intelligent translation devices mark an important innovation for cross-language communication. By merging AI technology with wearable design, users can communicate more freely. As awareness continues to rise, AI translation earbuds are set to play a vital role in a multilingual world.
https://pads.jeito.nl/s/fezIzgDkUR