Jump to content
Sign in to follow this  
jruths

Magazine layout of imgs within single post

Recommended Posts

jruths

Within a single post, I want to display images in a nice clean way, without just listing them (which seems boring). I found some php code to create a magazine type layout for a set of pictures (see: http://www.alistapart.com/articles/magazinelayout/). Question 1: Is there a nice way of doing this in the theme already. I don't want to create features/highlights/boxes for each post. If not... Question 2: How can I add some custom php code within the content area of a single post page. Note that each post will have different pictures, so the php will be a little different each time (so it doesn't belong in the template, or in hooks seemingly). Right now I tried putting the code in and it just prints it out like text in the preview. The code to insert is something like this: ` "; $mag = new magazinelayout($width,$padding,$template); $mag->addImage('pic1.jpg'); $mag->addImage('pic2.jpg'); $mag->addImage('pic3.jpg'); $content = $mag->getHtml(); echo $content ?> ` I also tried wrapping this preceded by `?>` and followed by `<?php`

Share this post


Link to post
Share on other sites
catrina
Question 2: How can I add some custom php code within the content area of a single post page.
PHP can't be added within the HTML editor of the post or page editor pages. If you're going to add PHP, you'll need to make copies of the PHP files you want to change, put them in the platformbase (child theme) folder, and edit the PHP there.

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×