Solved

split "the_content"

Posted on 2011-09-11
6
434 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

 

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Suggested Solutions

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 …
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 prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

752 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