Pages

Search This Website

Sunday, May 10, 2020

Add Read More Link to Copied Text in WordPress

Add Read More Link to Copied Text: आपने देखा होगा कि कुछ लोकप्रिय वेबसाइट अपनी साइट से कॉपी किए गए किसी भी Text के लिए “Read More” लिंक include करते है। यह नए Users को प्राप्त करने का एक शानदार तरीका है। अक्सर लोग ईमेल में वेबसाइटों से text कॉपी और पेस्ट करते हैं। कुछ इसे भविष्य के लिए जानकारी को बचाने के लिए उपयोग करते हैं, जबकि अन्य इसे केवल अपने दोस्तों, परिवार और सहयोगियों के साथ साझा करने के लिए करते हैं। In this article हम आपको दिखाने जा रहे हैं कि कैसे आप आसानी से अपने Website से किसी भी कॉपी किए गए टेक्स्ट के लिए “Read More” लिंक जोड़ सकते हैं, ताकि आप अतिरिक्त ट्रैफ़िक प्राप्त कर सकें।

Add Read More Link to Copied Text in WordPress

जब भी कोई आपकी वेबसाइट या ब्लॉग से Text कॉपी करता है तो क्या आप अपनी content में एक और लिंक जोड़ना चाहते हैं? तो फिर आप सही जगह पर आए।

In this article, we are going to show you how you can easily add a “Read More” link to any copied text from your WordPress blog, so you can get additional traffic or backlink if they posted to forums or on their website.

2. How to Add Read More Link to Copied Text By Javascript:

Option-1: You can copy and paste the below javascript into the >head< section of your page.

<script type="text/javascript"&gt;// <![CDATA[function addLink() {    if (window.getSelection().containsNode(document.getElementsByClassName('entry-content')[0], true)) {    var body_element = document.getElementsByTagName('body')[0];    var selection;    selection = window.getSelection();    var oldselection = selection    var url = document.URL    var pagelink = "  Read more at The Web Taylor: PAGE TITLE HERE <a href='" + url + "'&gt;" + url + "</a&gt;"; // Change this to suit    var copy_text = selection + pagelink;    var new_div = document.createElement('div');    new_div.style.left='-99999px';    new_div.style.position='absolute';     body_element.appendChild(new_div );    new_div.innerHTML = copy_text ;    selection.selectAllChildren(new_div );    window.setTimeout(function() {        body_element.removeChild(new_div );    },0);}} document.oncopy = addLink;// &amp;#93;&amp;#93;&gt;</script&gt;

Download Code Here

Option-2: if you are using WordPress, copy, and paste the below code into your functions.php file.

For instance, Steps to Use Read More Link Code

  • Copy the below code.
  • Open your theme’s functions.php file.
  • Paste the below code.
  • After that, Save
  • View the result in the browser by copy some text from your website.
  • And paste it anywhere.

First thing you need to do is copy the following code into your theme’s functions.php file or a site-specific plugin:

function add_copyright_text() {    if (is_single()) { ?&gt; <script type='text/javascript'&gt;function addLink() {    if (window.getSelection().containsNode(document.getElementsByClassName('entry-content')[0], true)) {    var body_element = document.getElementsByTagName('body')[0];    var selection;    selection = window.getSelection();    var oldselection = selection    var pagelink = "<br /&gt;<br /&gt; Read more at Latestinfo.org: <?php the_title(); ?&gt; <a href='<?php echo wp_get_shortlink(get_the_ID()); ?&gt;'&gt;<?php echo wp_get_shortlink(get_the_ID()); ?&gt;</a&gt;"; //Change this if you like    var copy_text = selection + pagelink;    var new_div = document.createElement('div');    new_div.style.left='-99999px';    new_div.style.position='absolute';     body_element.appendChild(new_div );    new_div.innerHTML = copy_text ;    selection.selectAllChildren(new_div );    window.setTimeout(function() {        body_element.removeChild(new_div );    },0);}}document.oncopy = addLink;</script&gt; <?php}}add_action( 'wp_head', 'add_copyright_text');

Download Code Here

Note: In addition, Don’t forget to change the copyright text and add your own site’s title there.

2. Similarly, Using WordPress Plugin:

In other words If you are using WordPress, you can use the Read More Copy Link plugin. यदि आप वर्डप्रेस का उपयोग कर रहे हैं तो आप इस Plugin का उपयोग करें और इसे बहुत आसानी से “Add Read More Link to Copied Text” फ़ंक्शन को सक्रिय कर सकते हे।

Above all, अब, जब भी कोई आपकी वेबसाइट पर Text कॉपी करता है तो content में एक और लिंक जुड़ जायेगा|

अंत में निष्कर्ष

यदि आपके मन में इस article को लेकर कोई भी doubts हैं या आप चाहते हैं की इसमें कुछ सुधार होनी चाहिए। तब इसके लिए आप नीच comments लिख सकते हैं.

After that, यदि आपको यह Article पसंद आया हो तो कृपया इस पोस्ट को Social media में share कीजिये.

No comments:

Post a Comment

 

અમારા વોટ્સએપ ગ્રુપમાં જોડાવા માટે ~~>અહીં ક્લિક કરો

News