• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 454
  • Last Modified:

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?

0
Refael
Asked:
Refael
2 Solutions
 
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
 
ovi_mihaiCommented:
maybe usng some regExp.. but it would be some work.
using Featured images (+ MultiPostThumbnails) you can separate text and images better
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
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
 
gwkgCommented:
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
 
ovi_mihaiCommented:
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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now