L
L
Lici2017-05-04 15:49:21
CMS
Lici, 2017-05-04 15:49:21

How to display text and meta tags on a WordPress page with parameters?

There is a page like /ru/yahty/?type=catamaran
From the admin panel, it is not identified in any way. It is
necessary to set a certain title, description and display a certain text on
it. How can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fedor, 2017-05-04
@purplesky

Make the urls normal and rejoice. This is some kind of perversion.

O
Otrivin, 2017-05-04
@Otrivin

The first way is to redirect via htaccess to a new page with the desired content, without rewriting the url;
The second way is to shamanize the template itself:
1) define the template file used to render the page. Usually, it is not monolithic, header.php is loaded into the template responsible for the body of the page
2) determine the places where info should change. So, for the title it is

<title><?php тут функция получения тайтла ?></title>
, which is in the header; for the text of the page there will be a similar construction, it will be located in the page template itself. In all these places, add a check for url (if… else), if it matches, execute " echo 'your content'; ", if it doesn't match, execute the standard content output function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question