Solved

split "the_content"

Posted on 2011-09-11
6
426 Views
Last Modified: 2012-06-21


Is it possible to split the <?php the_content(); ?>
What i mean is having the text, photos and etc in separated div?

0
Comment
Question by:Refael
6 Comments
 
LVL 4

Expert Comment

by:Ryan Weaver
ID: 36522409
Out of the box, I don't think so:
Function Reference/the content
Customizing the Read More
0
 
LVL 4

Expert Comment

by:h4hardy
ID: 36540902
no you are not able to do the same.
0
 
LVL 3

Expert Comment

by:ovi_mihai
ID: 36565313
maybe usng some regExp.. but it would be some work.
using Featured images (+ MultiPostThumbnails) you can separate text and images better
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:Refael
ID: 36566380

Hi ovi_mihai, thanks,

I do use the 'Featured images' that's why i want to control the text div and the image div.
Thanks.
0
 
LVL 31

Accepted Solution

by:
gwkg earned 250 total points
ID: 36582774
You can do anything you want to the_content() with a custom function and filter.

http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content

Exactly how to create a function that separates the images from the text is a question better asked in the PHP zone.
0
 
LVL 3

Assisted Solution

by:ovi_mihai
ovi_mihai earned 250 total points
ID: 36584053
regexp is not pretty

try patern like /<img([^>]*)>/

in a preg_match_all function.

then you'll need to remove the images with preg_replace and the same patern.

it should work fine but it is not the sure way
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to install BuddyPress on your self-hosted WordPress site It’s been called everything from “social networking in a box” to “Facebook without the terms of service,” but until Feb. 16, BuddyPress was a relatively unknown outside the WordPress MU…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question