Solved

split "the_content"

Posted on 2011-09-11
6
430 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
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…
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…

828 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