WordPress non-regular get the first image of the article

Circulated onlineWordPressThe method of obtaining the first picture of the article as a thumbnail is achieved by using regular matching crawling,code show as below: function catch_that_image() { global $post, $posts; $first_img = ”; ob_start(); ob_end_clean(); $output = preg_match_all(‘/<img.+src=[‘”]([^'”]+)[‘”].*>/i’, $post->post_content, $matches); $first_img = $matches[1][0]; if(empty($first_img)){ $first_img = ‘/images/default.jpg’; } return $first_img; } Some people say that […]

WordPress RSS format comment author name tag: comment_author_rss

WordPress template tags comment_ author_ RSS is used to output the comment author name in RSS format, which has no parameters. comment_author_rss() Examples of function usage <title>comment by: <?php comment_author_rss() ?></title> Extended reading comment_ author_ The rss() function is located at: WP includes / comment- template.php Related tags: cancel_ comment_ reply_ link() comment_ author() comment_ […]

WordPress comment form title tags: comment_form_title

WordPress template tags comment_ form_ Title is used to output the title of a comment form, which is usually used in a custom comment template. comment_form_title( string $noreplytext = false, string $replytext = false, boolean $linktoparent = true ) Function parameters $noreplytext String value, default value: leave a reply The text that will be displayed […]

WordPress RSS format comment content tag: comment_text_rss

WordPress template tags comment_ text_ RSS is used to output comments in RSS format. Usually in a custom comment template, this function has no parameters. comment_text_rss(); Examples of function usage <description><?php comment_text_rss() ?></description> Extended reading comment_ text_ The rss() function is located at: WP includes / comment- template.php Related tags: cancel_ comment_ reply_ link() comment_ […]

WordPress RSS comment link tag: comment_link_rss

WordPress template tags comment_ link_ RSS is used to output comment links in RSS format. This function has no parameters, and you need to pay attention to comment_ link_ The RSS function has been abandoned. It is recommended not to use it again. comment_link_rss() Examples of function usage <link><?php comment_link_rss() ?></link> Extended reading comment_ link_ […]

WordPress RSS comments link tag: Permalink_comments_rss

WordPress template tags Permalink_ comments_ RSS is used to output comment links in RSS format. This function has been abandoned and is not recommended. permalink_comments_rss() Examples of function usage <link><?php permalink_comments_rss(); ?></link> Extended reading permalink_ comments_ The rss() function is located at: WP includes / comment- template.php cancel_ comment_ reply_ link() comment_ author() comment_ author_ […]

WordPress comment reply link tag: comment_reply_link

WordPress template tags comment_ reply_ Link is used to output a comment reply link, which is usually used in a custom comment template. comment_reply_link( array $args = array(), integer $comment = null, integer $post = null ) Function parameters$args Array. The default values are as follows: $defaults = array( ‘add_below’ => ‘comment’, ‘respond_id’ => ‘respond’, […]