Replies: 0
I would like to add an abbreviated description that you would see if you click on one of the portfolio tiles. This JS will add the element and new HTML but now I need to pull the description over to insert it.
window.addEventListener('load', () => {
let target = document.querySelector('.entry-title')
let newElem = document.createElement('p');
let excerpt = 'This will be the excerpt...'
newElem.innerHTML = excerpt
target.parentNode.insertBefore(newElem, target.nextSibling);
})
Now I just need to find the short code for the description and replace the hardcoded ‘excerpt’ value with that. How do I find this code?