Search found 11 matches

by Gohh
Thu Apr 09, 2020 7:59 am
Forum: General
Topic: Print tag or category name
Replies: 7
Views: 69226

Re: Print tag or category name

Jay wrote: Thu Apr 09, 2020 1:10 am
Gohh wrote: Wed Apr 08, 2020 2:36 pm
Thank you, now works!
Your'e welcome :)


I hope you wont eat your own teeth on this piece of software like I did ;)
I didn't quite understand the point, but I'll be careful :D
by Gohh
Wed Apr 08, 2020 11:21 pm
Forum: General
Topic: The title of the next and previous post
Replies: 5
Views: 4859

Re: The title of the next and previous post

I have a problem. The previous post is running, the next one shows the current post. <?php $prevPage = $page->previousKey(); $page = buildPage($prevPage); echo ' <a href="' . $page->permalink() . '">' . $page->title() . '</a> '; ?> <?php $nextPage = $page->nextKey(); $page = buildPage($nex...
by Gohh
Wed Apr 08, 2020 2:36 pm
Forum: General
Topic: Print tag or category name
Replies: 7
Views: 69226

Re: Print tag or category name

Ohh I just realized you are trying to use a snippet from bludit docs. The mentioned exception to show code on a tag page works as supposed, as I had to make some small changes on my own bloggie couple days ago. Right after I ended fixes I found this code in docs, and just of sheer curiosity I tried...
by Gohh
Wed Apr 08, 2020 2:33 pm
Forum: General
Topic: Print time ago
Replies: 2
Views: 2787

Re: Print time ago

Edi wrote: Wed Apr 08, 2020 2:06 pm There is no value timeago.

If you need this you have to modify the output of the value time with a calculation.
?

Code: Select all

<?php echo $time->timeago(); ?>
by Gohh
Wed Apr 08, 2020 2:25 pm
Forum: General
Topic: Add "default image" instead of empty image
Replies: 3
Views: 3205

Re: Add "default image" instead of empty image

Then you have to add an else condition with the path to the default image. Thank you, it worked! <?php if (empty($page->coverImage())) : ?> <img src="<?php echo '/bl-themes/1/img/default-img.jpg' ?>" alt=""> <?php endif ?> How can I get a link to the current theme?
by Gohh
Wed Apr 08, 2020 1:53 pm
Forum: General
Topic: Print time ago
Replies: 2
Views: 2787

Print time ago

How to print a time ago?
I try it this way, it doesn't work:

Code: Select all

<?php echo $page->timeago(); ?>
by Gohh
Wed Apr 08, 2020 12:58 pm
Forum: General
Topic: Add "default image" instead of empty image
Replies: 3
Views: 3205

Add "default image" instead of empty image

Hello, if the image of the post is not selected, how to add "default image"? I print this: <?php if ($page->coverImage()) : ?> <a href="<?php echo $page->permalink(); ?>"> <img src="<?php echo $page->coverImage(); ?>"> </a> <?php endif ?>
by Gohh
Wed Apr 08, 2020 7:40 am
Forum: General
Topic: Print tag or category name
Replies: 7
Views: 69226

Re: Print tag or category name

Edited like this: <?php if ($WHERE_AM_I == 'category') : ?> <?php $categoryKey = $url->slug(); $category = new Category($categoryKey); echo $category->name(); ?> <?php endif ?> <?php if ($WHERE_AM_I == 'tag') : ?> <?php $tagKey = $Url->slug(); $tag = new Tag($tagKey); echo $tag->name(); ?> <?php end...
by Gohh
Tue Apr 07, 2020 11:45 pm
Forum: General
Topic: Print tag or category name
Replies: 7
Views: 69226

Print tag or category name

Hello, I print a name depending on the category it is or the tag. The name of the category is printed, the name of the tag is not :( <h2> <?php if ($WHERE_AM_I == 'category') : ?> <?php $categoryKey = $url->slug(); $category = new Category($categoryKey); echo $category->name(); ?> <?php elseif ($WHE...
by Gohh
Sun Aug 25, 2019 12:18 am
Forum: General
Topic: The title of the next and previous post
Replies: 5
Views: 4859

Re: The title of the next and previous post

Is there a solution to my problem? :oops: