Solved

split "the_content"

Posted on 2011-09-11
6
423 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

What's this? As a volunteer Page Editor for Experts-Exchange.com, I have noticed that many authors also have blogs, and pull articles from their blogs to post at Experts-Exchange. I appreciate each author sharing their blog content with our site …
Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
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…
This video teaches users how to migrate an existing Wordpress website to a new domain.

757 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

22 Experts available now in Live!

Get 1:1 Help Now