Solved

split "the_content"

Posted on 2011-09-11
6
425 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
erros on link  checking 2 60
css question 1 45
Wordpress/Dreamweaver Did we get lied to when they created our website? 9 65
Your suggestions for a Wordpress Theme 2 33
Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now