»WordPress»WordPress gets and outputs the first link of the article
Many people can get the first picture of the article from WordPress, but it seems that they haven't seen the first link of the article from WordPress. Today Cloudfall shares the results of today's struggle
preface
These days, a friend in the group made my reprint source a direct link to e-commerce products. First, he liked it, and then another friend said, "Do you want to add it here every time?"?How troublesome..➡ First of all, I despised it silently, and then thought about whether I could automatically get the first link of the article and output it. When I thought about this problem, the first thing I thought of was to get the article image and output it, use the regular matching A tag, and then obtain the results. Although it was a bit boring, it was also successful, but today I talked about a simpler method,I will not mention the regular one before.
function code
Put the following code into the topicfunctions.phpIn file