How to remove date and duration of reading time on a sticky post ?
- jeronath
- Sr. Bludit
- Posts: 37
- Joined: Tue Apr 26, 2022 11:54 am
- Location: Paris
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Hello everybody,
As the title of my topic makes clear, I would like to remove the date and duration of reading on the sticky post that I made for my home page and I don't find anyway to do this.
Home page of https://jeronath.net
Does anybody have an idea ?
Thanks a lot for your attention !
Nath
As the title of my topic makes clear, I would like to remove the date and duration of reading on the sticky post that I made for my home page and I don't find anyway to do this.
Home page of https://jeronath.net
Does anybody have an idea ?
Thanks a lot for your attention !
Nath
JeroNath
https://laminutespirituelle.fr
https://laminutespirituelle.fr
- novafacile
- Master Bludit
- Posts: 110
- Joined: Sat Oct 06, 2018 4:47 pm
- Has thanked: 37 times
- Been thanked: 11 times
- Contact:
This depends on the theme you use. Wich theme do you use?
The date and author are shown with
You have to remove this from the theme file of the static page.
Most themes uses the same theme file for static pages and blog pages. If your theme use the same file for both and you want to show date and author on blog pages, then you have to integrate an if/then/else of page type.
The date and author are shown with
Code: Select all
$page->date();
Code: Select all
$page->author([...]);
Most themes uses the same theme file for static pages and blog pages. If your theme use the same file for both and you want to show date and author on blog pages, then you have to integrate an if/then/else of page type.
- jeronath
- Sr. Bludit
- Posts: 37
- Joined: Tue Apr 26, 2022 11:54 am
- Location: Paris
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Hello,
Thanks for your help !
I am not a skilled developer and don't know php...
I just use blogx with several plugins...
It is not a static page but a pinned one without title and under there are the posts.
Can you give me more precise indications ?
Thanks in advance.
Thanks for your help !
I am not a skilled developer and don't know php...
I just use blogx with several plugins...
It is not a static page but a pinned one without title and under there are the posts.
Can you give me more precise indications ?
Thanks in advance.
JeroNath
https://laminutespirituelle.fr
https://laminutespirituelle.fr
- novafacile
- Master Bludit
- Posts: 110
- Joined: Sat Oct 06, 2018 4:47 pm
- Has thanked: 37 times
- Been thanked: 11 times
- Contact:
Oh I see I misunderstood your need a bit, you want to remove this only for sticky posts. You can do something like this:
Add this in the following file /bl-themes/blogx/php/home.php
Line 19
Line 25
This should removes it from every sticky post. Please test if it's works. Currently I can't test it, this is just an untested idea. Hope it helps.
Add this in the following file /bl-themes/blogx/php/home.php
Line 19
Code: Select all
if(!$page->sticky()){
Code: Select all
}
- jeronath
- Sr. Bludit
- Posts: 37
- Joined: Tue Apr 26, 2022 11:54 am
- Location: Paris
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Thanks for your help !novafacile wrote: ↑Wed May 11, 2022 11:15 pm
Line 19Line 25Code: Select all
if(!$page->sticky()){
Code: Select all
}
I have tried but got a bad result : no more web site at all. So I go back to the previous version !
But I think it is because I don't understand where to put the code. Maybe your file is not exactly the same as mine...
Can you give me a sample of your solution by showing the right place in the code. Sorry for my incompetence !
Best regards.
Nath
JeroNath
https://laminutespirituelle.fr
https://laminutespirituelle.fr
- novafacile
- Master Bludit
- Posts: 110
- Joined: Sat Oct 06, 2018 4:47 pm
- Has thanked: 37 times
- Been thanked: 11 times
- Contact:
The idea is to replace this
with this:
But I am not 100% sure if this is completely correct. I can't test it right now because I'm traveling.
Code: Select all
<!-- Creation date -->
<h6 class="card-subtitle mb-4 text-muted">
<i class="bi bi-calendar"></i><?php echo $page->date(); ?>
<i class="ms-3 bi bi-clock-history"></i><?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?>
</h6>
Code: Select all
if (!$page->sticky()){
<!-- Creation date -->
<h6 class="card-subtitle mb-4 text-muted">
<i class="bi bi-calendar"></i><?php echo $page->date(); ?>
<i class="ms-3 bi bi-clock-history"></i><?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?>
</h6>
}
- novafacile
- Master Bludit
- Posts: 110
- Joined: Sat Oct 06, 2018 4:47 pm
- Has thanked: 37 times
- Been thanked: 11 times
- Contact:
Otherwise you can remove the whole code of this, but then it's never shown.
- jeronath
- Sr. Bludit
- Posts: 37
- Joined: Tue Apr 26, 2022 11:54 am
- Location: Paris
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Thanks a lot for your help !novafacile wrote: ↑Thu May 12, 2022 3:02 pm Otherwise you can remove the whole code of this, but then it's never shown.
Starting from your proposal and using a little logic by comparing other pieces of code in the page I made :
Code: Select all
<!-- Creation date -->
<?php if (!$page->sticky()): ?>
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?></h6>
<?php endif ?>
Code: Select all
<!-- Creation date -->
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?></h6>
Great !
Thanks !
JeroNath
https://laminutespirituelle.fr
https://laminutespirituelle.fr
- novafacile
- Master Bludit
- Posts: 110
- Joined: Sat Oct 06, 2018 4:47 pm
- Has thanked: 37 times
- Been thanked: 11 times
- Contact:
Ah of course, I forgot the html context...jeronath wrote: ↑Fri May 13, 2022 5:10 pm Starting from your proposal and using a little logic by comparing other pieces of code in the page I made :Code: Select all
<!-- Creation date --> <?php if (!$page->sticky()): ?> <h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?></h6> <?php endif ?>