Mediumish: Change Number of Sticky Posts on Homepage

Post Reply
jack123
Jr. Bludit
Posts: 2
Joined: Tue Oct 04, 2022 12:52 pm

Image

👆👆👆

I installed Mediumish theme. But on the main homepage, I can only see 2 featured posts so far. I need 4 as shown on the demo site here: https://www.themepush.com/freethemes/me ... index.html

What should I have to do for this?

Thanks.
Frodo
Jr. Bludit
Posts: 5
Joined: Fri Sep 09, 2022 5:00 pm

For this to work you need to fix the page.
This can be found when creating/editing text under Settings-> Advanced -> ART.
then do this with the 4 pages you want to fix.

Without this setting, only the last two articles are displayed as with you, but are not realy fixed.
jack123
Jr. Bludit
Posts: 2
Joined: Tue Oct 04, 2022 12:52 pm

what is ART? I don't understand.

I saw that there is 2 post limit in home.php file. I can just change that to 4...would that be a problem? I tried it and it's working.
Frodo
Jr. Bludit
Posts: 5
Joined: Fri Sep 09, 2022 5:00 pm

German language system, ART is the selection box for the different types a text can have, standart, fixed, static ... I would try "fixed
2022-10-05-13-01-09_6400x2160.jpg
2022-10-05-13-01-09_6400x2160.jpg (92.7 KiB) Viewed 1041 times
edit:
Misunderstanding on my part, by feauterd post I mean a post that stays "on top" when you have already written other, new posts.
To achieve this, you must also set the post to "fixed".
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:

jack123 wrote: Wed Oct 05, 2022 12:10 pm I saw that there is 2 post limit in home.php file. I can just change that to 4...would that be a problem? I tried it and it's working.
The theme is a little bit tricky.

Default is two featured posts. You can change this by modifying the file home.php in the directory /bl-themes/mediumish-1.2/php.

You can for example use (line 21):

Code: Select all

<?php
   // Get the first and second page from the content
   $featured = array_slice($content, 0, 4);
   $content = array_slice($content, 4);
   foreach ($featured as $page):
?>
instead of

Code: Select all

<?php
   // Get the first and second page from the content
   $featured = array_slice($content, 0, 2);
   $content = array_slice($content, 2);
   foreach ($featured as $page):
?>
Further you have to set "Items per page" to "all content" ("Settings" > "General" > "Advanced").

At the moment the theme works only as one page website. I can try to fix this.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply