split "the_content"



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

RefaelAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
gwkgConnect With a Mentor Commented:
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
 
Ryan WeaverInfrastructure ManagerCommented:
Out of the box, I don't think so:
Function Reference/the content
Customizing the Read More
0
 
h4hardySr. Software EnginnerCommented:
no you are not able to do the same.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
ovi_mihaiCommented:
maybe usng some regExp.. but it would be some work.
using Featured images (+ MultiPostThumbnails) you can separate text and images better
0
 
RefaelAuthor Commented:

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
 
ovi_mihaiConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.