In the article about I looked at examples and codes for displaying some additional information elements on post pages: related notes, tag/category names, etc. A similar feature is also links to previous and next WordPress posts. These links will be useful when navigating site visitors, and are also another way. That is why I try to add them to each of my projects.

Four functions will help us in implementing the task, which I will discuss below:

Since we are talking about a Post page, in 99% of cases you will need to edit the template file single.php(or one where your theme specifies the format for displaying single articles). Functions are used in a Loop. If you need to remove the following / previous posts in WordPress, then look for the corresponding code in the same template file and delete (or comment out) it.

next_post_link function

By default, a link is generated to a note that has more than new date created immediately after the current one (since all posts are arranged in chronological order). Here's what it looks like in code and on the website:

Function syntax:

  • format(string) - defines general format generated link, where using the %link variable you can specify some text before and after it. By default, this is just a link with an arrow: ‘%link »’
  • link(string) - anchor link to the next post in WordPress, the %title parameter substitutes its title.
  • in_same_term(boolean) - determines whether only elements from the current category will be considered in the work. Valid values ​​are true / false (1 / 0), default is the second option.
  • excluded_terms(string or array) — specify the IDs of the blog categories whose posts will be excluded from the selection. Either array is allowed array(2, 5, 4) or writing it on a line separated by commas. Useful when working with GoGetLinks, when you need to prohibit the display of advertising posts in a given block.
  • taxonomy(string) - contains the name of the taxonomy from which the following entries are taken if the variable $in_same_term = true.

Judging by the screenshot above, it is clear that all these parameters are optional. Here is an example of using the function on one of my sites:

(next article)%link →","%title", FALSE, 152) ?>

Here I set my format for displaying the link + exclude from the selection all elements belonging to section ID = 152.

If you need to display the next post from the same category in WordPress, the code below will come in handy (ignoring the ID = 33 section):

When you want to work only with the current specific taxonomy, specify its name in the parameters (for example, testimonial):

>", TRUE, " ", "testimonial"); ?>

previous_post_link function

The principle of working with WordPress previous posts is similar to the description above, as is the syntax. Looks like that:

Relevant code:

  • format(string) - sets the format for which the %link variable is responsible (add text/tags before and after it). The default is '%link'.
  • link(string) - anchor link, to insert a title write %title.
  • in_same_term(boolean) - if true, then only objects from the same blog section will be displayed.
  • excluded_terms— remove unnecessary categories, specify the ID separated by commas (as a string) or in an array.
  • taxonomy(string) - Defines the taxonomy for selecting the previous post in WordPress if the $in_same_term parameter is active.

In one of my blogs I use:

%link", "<< Предыдущая", TRUE, "33"); ?>

Here we make a bold font + instead of the title of the element, a certain phrase is written (although it is better to use a title in linking). Only objects of the current category are displayed except for the one with ID = 33.

the_post_navigation function

This solution combines both previous and next links WordPress posts. This is done for convenience; it replaces calling two functions with one. If you need to output HTML code without display, use get_the_post_navigation().

The_post_navigation syntax is as simple as possible:

Where $args is a set of various optional parameters:

  • $prev_text— anchor of the previous link (%title by default).
  • $next_text— similar link text but to the next post (initially %title).
  • $in_same_term(true/false) - allows you to show only articles from the current taxonomy.
  • $excluded_terms— excluded IDs separated by commas.
  • $taxonomy— the name of the taxonomy for the selection, if in_same_term = true.
  • $screen_reader_text— the title of the entire block (by default — Post navigation).

Thus, we see that here there are the same variables as in the previous “single” functions previous_post_link, next_post_link: anchors, selection by taxonomies, etc. Using the solution will simply make your code more compact, and there is no point in repeating the same parameters twice.

Let's consider the simplest situation when you need to display items from the same category:

"next: %title", "next_text" => "previous: %title", "in_same_term" => true, "taxonomy" => "category", "screen_reader_text" => "More reading",)); ?>

posts_nav_link function

If I understand correctly, then it can be used not only for display in a single post, but also in categories, monthly notes, etc. That is, in single.php it will be responsible for links to previous/next WordPress articles, and in archived ones - for page navigation.

Posts_nav_link syntax:

  • $sep— a separator displayed between links (used to be::, now -).
  • $prelabel— link text of previous elements (default: “Previous Page”).
  • $nxtlabel— text for the next page/posts (“Next Page”).

Here is an interesting example with pictures instead of text links:

" , "" ) ; ?>

", ""); ?>

Just don't forget to upload the images. prev-img.png And next-img.png to the directory images in your . I think other HTML code is added in the same way if, for example, you need to use some DIV or class for alignment.

Total. By navigation there are still several others different functions, which you can find in the code. I hope everything is more or less clear with these. As for posts_nav_link, to be honest, I’m not sure whether it allows you to display previous and next posts on a single page, because I haven’t tested it, although it is mentioned in the description. I think in this case it is more effective and desirable to use the_post_navigation, which is newer and with a much larger number of parameters.

If you have any questions about navigation between posts or additions, write below.

A query language is a man-made programming language used to make queries in databases and information systems.

In general, such query methods can be classified depending on whether they are used for a database or for information retrieval. The difference is that requests to such services are made to obtain factual answers to the questions posed, while the search engine tries to find documents containing information related to the user's area of ​​interest.

Database

Database query languages ​​include the following examples:

  • QL - object-oriented, refers to the successor of Datalog.
  • Contextual Query Language (CQL) is a formal query representation language for information retrieval systems (such as web indexes or bibliographic catalogues).
  • CQLF (CODYASYL) - for CODASYL-TYPE databases.
  • Concept Oriented Query Language (COQL) - used in related models (com). It is based on construpt data modeling principles and uses operations such as projection and de-projection of multivariate analysis, analytical operations and inference.
  • DMX - used for models
  • Datalog is a deductive database query language.
  • Gellish English is a language that can be used to query Gellish English databases and allows conversations (requests and responses) and also serves to information modeling knowledge.
  • HTSQL - translates http requests to SQL.
  • ISBL - used for PRTV (one of the first relational database management systems).
  • LDAP is a query and directory services protocol that runs over TCP/IP.
  • MDX - required for OLAP databases.

Search engines

The search query language, in turn, is aimed at finding data in search engines. It differs in that queries often contain plain text or hypertext with additional syntax (such as “and”/“or”). It differs significantly from standard similar languages, which are governed by strict command syntax rules or contain positional parameters.

How are search queries classified?

There are three broad categories that cover most search queries: informational, navigational, and transactional. Although this classification has not been theoretically established, it has been empirically confirmed by the presence of actual queries in search engines.

Information queries are those that cover broad topics (such as a specific city or truck model) that can return thousands of relevant results.

Navigational queries are queries that search for a single site or web page on a specific topic (for example, YouTube).

Transactional - reflect the user's intention to perform a certain action, for example, purchase a car or book a ticket.

Search engines often support a fourth type of query, which is much less commonly used. These are so-called connection requests, containing a report on the connectivity of the indexed web graph (the number of links to a particular URL, or how many pages are indexed from a particular domain).

How is information searched?

Interesting characteristics regarding web search have become known:

The average search query length was 2.4 words.

  • About half of users made one request, and just under a third of users made three or more unique requests back to back.
  • Almost half of users only viewed the first one or two pages of results.
  • Less than 5% of users use advanced search capabilities (for example, selecting specific categories or searching in search).

Features of custom actions

The study also found that 19% of queries contained a geographic term (e.g. names, postal codes, geographical objects, etc.). It is also worth noting that in addition to short queries (that is, with several terms), there were often predictable patterns in which users changed their search phrases.

It was also found that 33% of requests from the same user are repeated, and in 87% of cases the user will click on the same result. This suggests that many users use repeat queries to revise or re-find information.

Frequency distributions of queries

In addition, experts confirmed that the frequency distributions of queries correspond to a power law. That is, a small part of the keywords are observed in the largest list of queries (for example, more than 100 million), and they are the most frequently used. The remaining phrases within the same topics are used less frequently and more individually. This phenomenon is called the Pareto principle (or the “80-20 rule”), and it has allowed search engines to use optimization techniques such as indexing or database partitioning, caching and preloading, and has also made it possible to improve the search engine's query language.

In recent years, it has been found that the average length of queries has been steadily increasing over time. So, the average request for English language became longer. In this regard Google company introduced an update called "Hummingbird" (in August 2013), which is capable of processing long search phrases with non-protocol, "colloquial" query language (like "where's the nearest coffee shop?").

For longer requests, their processing is used - they are divided into phrases formulated standard language, and answers to different parts are displayed separately.

Structured queries

Search engines that support both syntax use more advanced query languages. A user searching for documents covering multiple topics or facets can describe each of them by the logical characteristic of the word. At its core, a logical query language is a collection of certain phrases and punctuation marks.

What is advanced search?

The query language of Yandex and Google is capable of performing a more narrowly targeted search if certain conditions are met. Advanced search can search by part of the page title or title prefix, as well as specific categories and lists of names. It can also limit searches to pages that contain certain words in the title or are in certain topic groups. When used correctly, the query language can process parameters that are orders of magnitude more complex than the superficial results of most search engines, including user-specified words with variable endings and similar spellings. When you present advanced search results, a link to the relevant sections of the page will be displayed.

It is also possible to search for all pages containing a specific phrase, while with a standard query search engines cannot stop at any discussion page. In many cases, the query language can lead to any page located in the noindex tags.

In some cases, a correctly formed query allows you to find information containing a number of special characters and letters of other alphabets (Chinese characters, for example).

How are query language characters read?

Upper and lower case, as well as some (umlauts and accents) are not taken into account in the search. For example, a search for the keyword Citroen will not find pages containing the word "Citroen". But some ligatures correspond to individual letters. For example, a search for "aeroskobing" will easily find pages containing "Ereskobing" (AE = Æ).

Many non-alphanumeric characters are constantly ignored. For example, it is impossible to find information for a query containing the string |L| (letter between two vertical stripes), although this character is used in some conversion patterns. The results will only contain data from “LT”. Some characters and phrases are treated differently: a query for "credit (Finance)" will return entries with the words "credit" and "finance", ignoring the parentheses, even if there is an entry with the exact title "credit (Finance)".

There are many functions that can be used using a query language.

Syntax

The query language of Yandex and Google may use some punctuation marks to refine the search. An example is the curly braces - ((search)). The phrase contained in them will be searched in its entirety, without changes.

The phrase in allows you to determine the search object. For example, a word in quotation marks will be recognized as being used in a figurative sense or as a fictional character, without quotation marks - as information of a more documentary nature.

Additionally, all major search engines support the "-" symbol for logical "not" and also and/or. The exception is terms that cannot be prefixed with a hyphen or dash.

Inexact search phrase matches are marked with ~. For example, if you don't remember the exact wording of a term or name, you can enter it in the search bar with the specified symbol and you will be able to get results that are as similar as possible.

Custom Search Options

There are also search parameters such as intitle and incategory. They are filters displayed separated by a colon, in the form "filter: query string". The query string can contain the term or phrase you are searching for, or part or the entire page title.

The "intitle: request" function gives priority to search results by title, but also shows regular results by title content. Several of these filters can be used simultaneously. How to use this opportunity?

A query like “intitle: airport name” will return all articles containing the name of the airport in the title. If you formulate it as “parking intitle: airport name,” then you will get articles with the name of the airport in the title and mentioning parking in the text.

Search using the “incategory: Category” filter works on the principle of initially displaying articles belonging to a specific group or list of pages. For example, a search query like “Temples incategory: History” will return results on the topic of temple history. This function can also be used as an advanced function by specifying various parameters.

Who called from an unknown number and snorted into the phone? Who is "Lena of Mordor" who appeared in the phone book after Saturday's party? Enter the last 10 digits of your phone number into the search bar on Facebook and you'll likely get the answers. By default, the ability to find a person by phone number enabled for all users.


If you don't want this trick to happen to you, change your privacy settings.


2. Disable the “Viewed” status in messages

This feature ruins relationships and lives! Of course, who likes it when personally selected funny pictures and important news are openly ignored?


If you are not one of those who can calmly leave messages from acquaintances unanswered, use a browser extension. It disables the “Viewed/Unviewed” message status on the desktop version of Facebook. For the Chrome browser this is Facebook Unseen. For Firefox and Explorer - Chat Undetected. But there is also a negative point: with these extensions you will also not be able to see the read status.


3. Hide your online status from annoying friends

If you are completely tired of a friend, then turn off the chat with him. Click on the gear in the right column with the list of friends and select “Advanced settings”.


Messages from the disabled chat will be stored in the “Inbox” folder, but, unlike the previous point, you will not be able to read them unnoticed.


4. Look in your news feed only for posts from friends and communities you are subscribed to

Facebook wants to drag everyone into its quagmire as deeply as possible. This is why it shows users posts liked and commented on by friends. But there is a way to leave only posts from friends and communities you follow in your feed.

Install the friends feed extension in Chrome. With it, extraneous posts will either be hidden or covered with a gray veil - choose in the settings.

5. Read hidden messages

Who knows, maybe your life is not as boring as it seems. Perhaps you were called to the job of your dreams, secret admirers confessed their love, and their admirers threatened to kill you. But you didn’t know anything about this, because Facebook places messages from strangers on hidden folder and does not notify you about them in any way. Click on the “Other” tab (for many people it has recently been called “Correspondence Request”) next to the main messages and see everything that was hidden!

6. Hide your friends list from prying eyes

Let's not even speculate why you might be shy about your Facebook acquaintances. Just go to the “Friends” tab on your personal page, click on the pencil and indicate who can see the circle of your Facebook friends.

7. Disable video autoplay

In one fell swoop, you can bring a little peace of mind to your feed and save money. mobile traffic. To do this, disable automatic video playback. In the native Facebook application, go to your account settings > “Video and Photos” > “Autoplay” > select the desired setting.

8. Share GIFs on Facebook

Do you love GIFs as much as ? If the answer is positive, we will tell you how to share them on Facebook. Insert a link to the GIF into the status field (yes, you won’t be able to upload it directly from your computer). After it is loaded, the link can be deleted. Publish.

9. Change your relationship status without unnecessary drama

A long time may pass between the internal decision to end the relationship and the announcement of this to the other party. And I want to start looking for new romantic adventures on Facebook right away. By default, a notification about a change in your personal life appears in all friends' feeds. So don't forget to select the "Only Me" setting under "Information" > "Family and Relationships."

10. Bookmark interesting posts to read them later

Thousands of posts appear on your Facebook feed every day, it’s impossible to read everything, even if you completely abandon the idea of ​​working. Fortunately, the social network has a built-in bookmarking service. To save a post for later, click the arrow in the upper right corner.

Surely you have heard more than once about such a wonderful search engine as Google. I'm guessing you've used it more than once when you wanted to know something. But did you find what you wanted? If you search for answers on Google as often as I do, I think you will find this article useful because it is designed to make your search faster and more efficient. So, first, a little history...

Google is a corruption of the English word "googol", coined by Milton Sirotta, nephew of the American mathematician Edward Kaiser, to denote the number consisting of one and one hundred zeros. Now Google name wears the leader of Internet search engines, developed by Google Inc.

Google occupies more than 70% of the global market, which means that seven out of ten people online turn to its page when searching for information on the Internet. It currently registers about 50 million search queries daily and indexes more than 8 billion web pages. Google can find information in 101 languages. Google at the end of August 2004 consisted of 132 thousand machines located in different parts of the planet.

Google uses intelligent text analysis techniques to find important yet relevant pages for your query. To do this, Google analyzes not only the page itself that matches the query, but also the pages that link to it to determine the value of that page for the purposes of your query. Additionally, Google prefers pages that keywords, you entered are located close to each other.

The Google interface contains a rather complex query language that allows you to limit the search scope to specific domains, languages, file types, etc. Using some of the operators of this language allows you to make the search process necessary information more flexible and precise. Let's look at some of them.

Logical “AND”:
By default, when you write query words separated by spaces, Google searches for documents that contain all the query words. This corresponds to the AND operator. Those. a space is equivalent to the AND operator.

For example:
Cats dogs parrots zebras
Cats AND dogs AND parrots AND zebras
(both queries are the same)

Logical "OR" (OR):
Written using the OR operator. Please note that the OR operator must be written in capital letters. Relatively recently, it became possible to write a logical “OR” in the form of a vertical bar (|), similar to how it is done in Yandex. Used to search with several options for the required information.

For example:
Dachshunds long-haired OR smooth-haired
Long-haired dachshunds | smooth-haired
(both queries are the same)

Please remember that Google queries are not case sensitive! Those. the queries Greenland Island and Greenland Island will be exactly the same.

Operator "Plus" (+):
There are situations when you need to forcefully include in the text a word that may have different spellings. To do this, use the "+" operator before the required word. Suppose if we have a query at Home Alone I, as a result of the query we will have unnecessary information about “Home Alone II”, “Home Alone III” and quite a bit about “Home Alone I”. If we have a query of the form Home Alone +I, the result will only contain information about the movie “Home Alone I”.

For example:
Newspaper + Zarya
Bernoulli equation + mathematics

Excluding words from the query. Logical NOT (-):
As you know, information garbage is often encountered when composing a request. To remove it, exclusion operators are used as standard - logical “NOT”. In Google, this operator is represented by a minus sign. Using this operator, you can exclude from search results those pages that contain certain words in the text. Used like the "+" operator before the excluded word.

For example:
Crane well-bird
Dead Souls - novel

Search for an exact phrase (""):
In practice, searching for an exact phrase is required either to search for the text of a specific work, or to search for specific products or companies in which the name or part of the description is a consistently repeated phrase. To cope with this task using Google, you need to enclose the query in quotation marks (meaning double quotes, which are used, for example, to highlight direct speech).

For example:
The work "Quiet Don"
“It was cold outside, although this did not prevent Boris from carrying out his plans”

By the way, Google allows you to enter no more than 32 words into the query bar!

Word truncation (*):
Sometimes you need to look for information about a word combination in which one or more words are unknown. For these purposes, instead of unknown words, the “*” operator is used. Those. "*" - any word or group of words.

For example:
Master and *
Leonardo * Vinci

cache operator:
The search engine stores the version of the text that is indexed by the search spider in a special storage format called a cache. A cached version of a page can be retrieved if the original page is unavailable (for example, the server on which it is stored is down). A cached page is shown as it is stored in the search engine's database and is accompanied by a notice at the top of the page indicating that it is a cached page. It also contains information about the time the cached version was created. On the page from the cache, the query keywords are highlighted, and each word is highlighted in a different color for user convenience. You can create a request that will immediately return a cached version of a page with a specific address: cache: page_address, where instead of “page_address” is the address of the page saved in the cache. If you need to find any information in a cached page, you need to write a request for this information separated by a space after the page address.

For example:
cache:www.bsd.com
cache:www.knights.ru tournaments

We must remember that there should not be a space between ":" and the page address!

Filetype operator:
As you know, Google indexes not only html pages. If, for example, you needed to find some information in a file type other than html, you can use the filetype operator, which allows you to search for information in a specific file type (html, pdf, doc, rtf...).

For example:
Specification html filetype:pdf
Essays filetype:rtf

Operator info:
The info operator allows you to see the information that Google knows about this page.

For example:
info:www.wiches.ru
info:www.food.healthy.com

Site operator:
This operator limits the search to a specific domain or site. That is, if you make a request: marketing intelligence site:www.acfor-tc.ru, then the results will be obtained from pages containing the words “marketing” and “intelligence” on the site “acfor-tc.ru” and not on others parts of the Internet.

For example:
Music site:www.music.su
Books site:ru

Link operator:
This operator allows you to see all the pages that link to the page for which the request was made. Thus, the request link:www.google.com will return pages that contain links to google.com.

For example:
link:www.ozone.com
Friends link:www.happylife.ru

allintitle operator:
If you start a query with the allintitle operator, which translates as “everything is in the title,” then Google will return texts in which all the words of the query are contained in the titles (inside the TITLE tag in HTML).

For example:
allintitle: Free software
allintitle: Download music albums

intitle operator:
Shows pages in which only the word immediately after the intitle operator is contained in the title, and all other query words can be anywhere in the text. Putting the intitle operator before each word of the query is equivalent to using the allintitle operator.

For example:
Programs intitle: Download
intitle: Free intitle: download software

allinurl operator:
If the query begins with the allinurl operator, then the search is limited to those documents in which all the query words are contained only in the page address, that is, in the url.

For example:
allinurl:rus games
allinurl:books fantasy

inurl operator:
The word that is located directly together with the inurl operator will be found only in the address of the Internet page, and the remaining words will be found anywhere in such a page.

For example:
inurl:books download
inurl:games crack

Operator related:
This operator describes pages that are "similar" to some specific page. Thus, the query related:www.google.com will return pages with similar topics to Google.

For example:
related:www.ozone.com
related:www.nnm.ru

The define statement:
This operator acts as a kind of explanatory dictionary, which allows you to quickly get the definition of the word that is entered after the operator.

For example:
define: Kangaroo
define: Motherboard

Synonym search operator (~):
If you want to find texts containing not only your keywords, but also their synonyms, then you can use the “~” operator before the word for which you want to find synonyms.

For example:
Types of ~metamorphoses
~Object orientation

Range operator (..):
For those who have to work with numbers, Google has made it possible to search for ranges between numbers. In order to find all pages containing numbers in a certain range “from - to”, you need to put two dots (..) between these extreme values, that is, the range operator.

For example:
Buy a book $100..$150
Population 1913..1935

Here are all the Google query language operators I know. I hope they will somehow make your search process easier. necessary information. In any case, I use them very often and I can say with confidence that when using them I spend significantly less time searching than without them.

Good luck! And may the Force be with you.

Tags: search, operators, Google

The following is an alphabetical list of the search operators. This list includes operators that are not officially supported by Google and not listed in Google's online help.

Note: Google may change how undocumented operators work or may eliminate them completely.

Each entry typically includes the syntax, the capabilities, and an example. Some of the search operators won’t work as intended if you put a space between the colon (:) and the subsequent query word. If you don’t care to check which search operators require no space after the colon, always place the keyword immediately next to the colon. Many search operators can appear anywhere in your query. In our examples, we place the search operator as far to the right as possible. We do this because the Advanced Search form writes queries in this way. Also, such a convention makes it clearer as to which operators are associated with which terms.

Allinanchor:

If you start your query with allinanchor: , Google restricts results to pages containing all query terms you specify in the on links to the page. For example, [ allinanchor: best museums sydney] will return only pages in which the anchor text on links to the pages contain the words “best,” “museums,” and “sydney.”

Group:

If you include group: in your query, Google will restrict your Google Groups results to newsgroup articles from certain groups or subareas. For example, [ sleep group:misc.kids.moderated ] will return articles in the group misc.kids.moderated that contain the word “sleep” and [ sleep group:misc.kids ] will return articles in the subarea misc.kids that contain the word “sleep.”

Id: intitle:

The query intitle: term restricts results to documents containing term in the . For instance, [ flu shot intitle:help] will return documents that mention the word “help” in their titles, and mention the words “flu” and “shot” anywhere in the document (title or not).

Note: There must be no space between the intitle: and the following word.

Putting intitle: in front of every word in your query is equivalent to putting allintitle: at the front of your query, e.g., [ intitle:google intitle:search] is the same as [ allintitle: google search ].

If you include inurl: in your query, Google will restrict the results to documents containing that word in the . For instance, searches for pages on Google Guide in which the URL contains the word “print.” It finds pdf files that are in the directory or folder named “print” on the Google Guide website. The query [ inurl:healthy eating] will return documents that mention the words “healthy” in their URL, and mention the word “eating” anywhere in the document.

Note: There must be no space between the inurl: and the following word.

Putting inurl: in front of every word in your query is equivalent to putting allinurl: at the front of your query, e.g., [ inurl:healthy inurl:eating] is the same as [ allinurl: healthy eating ].

In URLs, words are often run together. They need not be run together when you're using inurl:.

The query link: URL shows pages that point to that. For example, to find pages that point to Google Guide’s home page, enter:

Find links to the UK Owners Direct home page not on its own site.

Location: related:

You can also restrict your results to a site or domain through the domains selector on the Advanced Search page.