How to write only for first main page?

Post Reply
GEORGE
Jr. Bludit
Posts: 5
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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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

Bludit does not use code with square brackets.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
GEORGE
Jr. Bludit
Posts: 5
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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 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!";
}
?>
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
GEORGE
Jr. Bludit
Posts: 5
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.
My decision:

Code: Select all

<?php if ($_SERVER['REQUEST_URI']=="/" || $_SERVER['QUERY_STRING'] == "page=1"): ?>
Post Reply