I didn't quite understand the point, but I'll be careful
Search found 11 matches
- Thu Apr 09, 2020 7:59 am
- Forum: General
- Topic: Print tag or category name
- Replies: 7
- Views: 70130
- Wed Apr 08, 2020 11:21 pm
- Forum: General
- Topic: The title of the next and previous post
- Replies: 5
- Views: 4941
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...
- Wed Apr 08, 2020 2:36 pm
- Forum: General
- Topic: Print tag or category name
- Replies: 7
- Views: 70130
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...
- Wed Apr 08, 2020 2:33 pm
- Forum: General
- Topic: Print time ago
- Replies: 2
- Views: 2809
Re: Print time ago
- Wed Apr 08, 2020 2:25 pm
- Forum: General
- Topic: Add "default image" instead of empty image
- Replies: 3
- Views: 3258
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?
- Wed Apr 08, 2020 1:53 pm
- Forum: General
- Topic: Print time ago
- Replies: 2
- Views: 2809
Print time ago
How to print a time ago?
I try it this way, it doesn't work:
I try it this way, it doesn't work:
Code: Select all
<?php echo $page->timeago(); ?>
- Wed Apr 08, 2020 12:58 pm
- Forum: General
- Topic: Add "default image" instead of empty image
- Replies: 3
- Views: 3258
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 ?>
- Wed Apr 08, 2020 7:40 am
- Forum: General
- Topic: Print tag or category name
- Replies: 7
- Views: 70130
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...
- Tue Apr 07, 2020 11:45 pm
- Forum: General
- Topic: Print tag or category name
- Replies: 7
- Views: 70130
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...
- Sun Aug 25, 2019 12:18 am
- Forum: General
- Topic: The title of the next and previous post
- Replies: 5
- Views: 4941
Re: The title of the next and previous post
Is there a solution to my problem?