Query posts is a very useful invocation of the article function, can be done with the page to display a variety of specific range of articles, such as can invoke a classification, tags, dates and authors, and other different ranges of the article list. The list of these articles can greatly enrich the content of WordPress pages and facilitate SEO. Second-hand sci
connect to your Web space via the FTP tool (FLASHFXP or FileZilla) and upload the plugin directory to/public_html/wp-content/plugins. After uploading, login admin backstage, click on plug-in template, you can see, upload plugin already in the list of not enabled.Click Enable again.
Plug in the following code where you want to display the relevant article:
"Plug-in Configuration"
In WP background-set-related Posts, enter the plug-in contr
Number of posts published on the day when wordpress callsWhen creating a wordpress topic, you need to call the number of articles published on the website of the current day. The blog post published the tutorial "number of articles for wordpress within a limited time period" to count the number of articles pu
This article mainly introduces the PHP function summary for judging, adding, and deleting WordPress top posts. For more information, see
Determine top postsThe is_sticky () function is used to determine whether an article is pinned.
Usage
is_sticky( $post_id );
Parameters
$ Post_id
(Integer) (optional) ID of the article to be judged. The default value is the current article in the loop.
Default Value: 0
.
$found _posts
Statistics how many articles will be available if paging is not enabled.
$max _num_pages
The total number of pages, the current article is divided into several pages.
$current _post
The index value of the current article. In a loop, the start loop $current _post is –1, plus 1 per loop, which represents the index value of the current loop to the article in $posts variable (array).
$post
The current article in the loop is an obje
based on the query conditions and store it in some variables. for details, see WordPress page judgment function.
Method
Init ()
Initialize the object. all attributes are set to null,-1, 0, or False to delete some attributes.
Parse_query ($ query)
Parse and save the query string.
Parse_query_vars ()
In the previous ver
First, I want to use some methods under this class and cannot directly call them. WordPress provides the global variable $ wpdb for this class, which is used to associate with the WordPress Database. Therefore, we need to define this global variable before using it. The code is as follows:Copy code Execute database queryUse the query function to execute any
16. Close messages from old posts
123
UPDATE wp_postsset comment_status = ' closed ' WHERE post_date
17. Update the URL of the message
12
UPDATE Wp_commentsset Comment_author_url = REPLACE (Comment_author_url, ' http://old URL. com ', ' http://new URL. com ')
18. Update the body of all ' target= ' _blank "' for ' rel=" nofollow "'
12
UPDATE Wp_postsset po
need before running the query.
The code is as follows:DELETE from Wp_postmeta WHERE meta_key = ' Yourmetakey ';
Find unwanted tagsIf you execute a query in the WordPress database to delete the old article, as in the case of deleting the plugin, the article will remain in the database and will appear in the tag list/tag cloud. The following
This article describes how to add a query string to a link in WordPress by using the add_query_arg () function, you can refer to the query string after the question mark in the link. the format is key = value. Separate multiple query statements with the symbol. The add_query_arg () function is a convenient function pr
Most use WordPress built site, after the table are MySQL database, often we need to customize the function of WordPress, here we list 10 most useful wordpress database query, you need a database management tools, such as phpMyAdmin or NAVICAT, etc. to execute these SQL statements.
1. Change the author of all documents
Release date:Updated on:
Affected Systems:WordPress Store Locator Plus Plugin 3.xDescription:--------------------------------------------------------------------------------Bugtraq id: 57222The WordPress Store Locator Plus Plug-in can place a shop search program on the site.WordPress Store Locator Plus 3.8.6 and earlier versions do not correctly verify wp-content/plugins/store-locator-le/downloadcsv. the value of the "
Reprinted from: http://blog.sina.com.cn/s/blog_a225d3970101331q.html
The query_posts function is only used to modify the Home Page loop, rather than generating a secondary loop on the page. If you want to generate another loop outside the main loop, you should create an independent wp_query object and use these objects to generate a loop. Using query_posts in a loop outside the main loop will lead to deviation of the main loop operation, and the page may display the content you do not want to
The query string refers to the query after the question mark in the link, formatted as Key=value, and multiple query statements separated by symbols. The Add_query_arg () function is a handy function provided by WordPress to help you add one or more query statements to a li
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.