Page 1 of 1
How to write only for first main page?
Posted: Thu Nov 24, 2022 8:04 pm
by GEORGE
How to write in home.php only for first main page? like this:
[aviable=main][page-count=1]
content
[/page-count][/aviable]
Re: How to write only for first main page?
Posted: Thu Nov 24, 2022 8:08 pm
by Edi
Sorry, I do not understand your question. What will you do?
Bludit does not use code with square brackets.
Re: How to write only for first main page?
Posted: Thu Nov 24, 2022 8:35 pm
by GEORGE
Edi wrote: ↑Thu Nov 24, 2022 8:08 pm
Sorry, I do not understand your question. What will you do?
Bludit does not use code with square brackets.
how do I write code in the home.php so that my text "hello world" was only on the main page and only on the first page?
Re: How to write only for first main page?
Posted: Fri Nov 25, 2022 11:34 am
by Edi
You can do it with the following code:
Code: Select all
<?php
if ($_SERVER['QUERY_STRING'] == "" || $_SERVER['QUERY_STRING'] == "page=1") {
echo "Hello World!";
}
?>
Re: How to write only for first main page?
Posted: Fri Nov 25, 2022 4:08 pm
by GEORGE
Edi wrote: ↑Fri Nov 25, 2022 11:34 am
You can do it with the following code:
Code: Select all
<?php
if ($_SERVER['QUERY_STRING'] == "" || $_SERVER['QUERY_STRING'] == "page=1") {
echo "Hello World!";
}
?>
thx its work! in category print too.
My decision:
Code: Select all
<?php if ($_SERVER['REQUEST_URI']=="/" || $_SERVER['QUERY_STRING'] == "page=1"): ?>