Önce aşağıdaki kodu single.php dosyasına ekle.
<script type="text/javascript">
document.getElementById("kopyala").addEventListener("click", function() {
copyToClipboardMsg(document.getElementById("icerik"), "msg");
});

document.getElementById("pasteTarget").addEventListener("mousedown", function() {
this.value = "";
});


function copyToClipboardMsg(elem, msgElem) {
var succeed = copyToClipboard(elem);
var msg;
if (!succeed) {
msg = "Kopyala desteklenmiyor veya izin verilmiyor. Lütfen ctrl+c yapın"
} else {
msg = "İçerik kopyalandı!"
}
if (typeof msgElem === "string") {
msgElem = document.getElementById(msgElem);
}
msgElem.innerHTML = msg;
setTimeout(function() {
msgElem.innerHTML = "";
}, 2000);
}

function copyToClipboard(elem) {
var targetId = "_hiddenCopyText_";
var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
var origSelectionStart, origSelectionEnd;
if (isInput) {
target = elem;
origSelectionStart = elem.selectionStart;
origSelectionEnd = elem.selectionEnd;
} else {
target = document.getElementById(targetId);
if (!target) {
var target = document.createElement("textarea");
target.style.position = "absolute";
target.style.left = "-9999px";
target.style.top = "0";
target.id = targetId;
document.body.appendChild(target);
}
target.textContent = elem.textContent;
}
var currentFocus = document.activeElement;
target.focus();
target.setSelectionRange(0, target.value.length);

var succeed;
try {
succeed = document.execCommand("copy");
} catch(e) {
succeed = false;
}
if (currentFocus && typeof currentFocus.focus === "function") {
currentFocus.focus();
}

if (isInput) {
elem.setSelectionRange(origSelectionStart, origSelectionEnd);
} else {
target.textContent = "";
}
return succeed;
}
</script>
Sonra yazının bulunduğu dive id="icerik" ekle.

Sonra aşağıdaki kodla kopyalama butonu ekle (Nerde gözükmesini istiyorsan)

<button id="kopyala">Kopyala</button>
İşlem bu kadar. Eğer içerik kopyalandı mesajı göstermek istiyorsan aşağıdaki kodu da istediğin bir yere ekleyebilirsin.

<span id="msg"></span>