MyBB Community Forums

Full Version: Displaying News on your homepage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
I'be been playing around with the code from anori and bootstrap and managed to get this as a test.
Has a nice 3 column for it also and only shows the latest 6 posts in the forum at a time.

I noticed images as attachments won't work as I tried that in test 4 post but it just shows the code [attachment=1] there instead of the image.

Also with any image that's posted in any news posts, example in "Test 3" I have the bootstrap auto resize code in the page's css to fit the width of the column.

On mobile this resizes to 1 column with a hamburger menu for the navbar.

Unfortunately there is no limit on length for the post so it'll grow to however long the article is which will be a problem which I would love to solve with a "Read More" link ill need to look into any advice?.

[Image: hGQPqnm.jpg]

This is a test of what its capable of and whether I end up using this I don't know, just playing around with some designs and ideas atm for a upcoming site.
For wraping, use wordwrap function, like:
$opis=wordwrap($desc, 40, true);

This will cut everything and will show only first 40 characters.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33