How to write only for first main page?

Post Reply
GEORGE
Jr. Bludit
Posts: 3
Joined: Thu Nov 24, 2022 7:59 pm
Has thanked: 1 time

How to write in home.php only for first main page? like this:
[aviable=main][page-count=1]
content
[/page-count][/aviable]
User avatar
Edi
Site Admin
Posts: 2903
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 28 times
Been thanked: 38 times
Contact:

Sorry, I do not understand your question. What will you do?

Bludit does not use code with square brackets.
GEORGE
Jr. Bludit
Posts: 3
Joined: Thu Nov 24, 2022 7:59 pm
Has thanked: 1 time

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?
User avatar
Edi
Site Admin
Posts: 2903
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 28 times
Been thanked: 38 times
Contact:

You can do it with the following code:

Code: Select all

<?php
if ($_SERVER['QUERY_STRING'] == "" || $_SERVER['QUERY_STRING'] == "page=1") {
   echo "Hello World!";
}
?>
GEORGE
Jr. Bludit
Posts: 3
Joined: Thu Nov 24, 2022 7:59 pm
Has thanked: 1 time

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.
what i try:

Code: Select all

<?php if ($WHERE_AM_I!='category' || $_SERVER['QUERY_STRING'] == "" || $_SERVER['QUERY_STRING'] == "page=1"): ?>
but its not work
Post Reply