Displays the contents of the current post. This template tag must be used within The_Loop.

learn more… | top users | synonyms

1
vote
1answer
199 views

How to place HTML tags in content from the_content()?

Firstly, I am new to Wordpress so thank you for your patience. I have a list of posts (with excerpts) being displayed in the page using Short Tags. The output is fine , However, I wish to add and ...
0
votes
3answers
916 views

How to output only the post content

How can I output ONLY the post content (ie the text entered into the wysiwyg) and nothing else? i just need this for the posts in a specific category, so if i could call like say, <?php ...
-1
votes
1answer
256 views

Shortcode append to the the_content()

Currently I have a short that embeds a div into the the_content. This works fine like thus: [shortcode param=1 param=2] This returns a message at the end of the post, but within the current article, ...
0
votes
1answer
80 views

Confused on loading page content

I'm building my first full site into WP and I am rather confused on the process involved to load the content you enter via the WP Pages editor into the actual page. For example, I am having a static ...
1
vote
1answer
181 views

Function to show only first instance of shortcode

I need to add a function to my theme to remove additional instances of a shortcode in a post. First off I wonder if i'm approaching this wrong, but I have a theme that is drastically reformats the ...
0
votes
1answer
262 views

Filters on the_content with plugins, pages and shortcode

I am using a plugin to add tweet, likes... This plugin add filters to the_content() to display this social buttons on a blog page (list of posts). I coded a shortcode which does a custom SQL query ...
3
votes
3answers
2k views

How to wrap an element around an iframe or embed in content automatically?

Id like to have wordpress automatically wrap a div around any iframe or embed when they are used in the_content...how might this be achieved?
0
votes
1answer
97 views

Query does not return content

Working on updating an old WP site developed for WordPress 2.0 and have a post (page) query that does not return the "post_content" data. Here is said query: $the_query = ...
2
votes
3answers
3k views

How do I add the featured image to the_content after the first paragraph?

My problem: I'm trying to create a filter that will add the featured image of a post to the_content, so that I can have the first paragraph of the_content displayed before this image. What I basicly ...
0
votes
1answer
695 views

Add custom PHP and HTML to the_content()

I am developing a wordpress website on the thematic framework. In my child theme i have made a full width page template called resources.php In this page template i have written custom php code which ...
1
vote
2answers
331 views

Include custom fields into the content of a regular page

Here's my setup: Parent "Gallery" page: _regular page, not custom type or anything _ Several "Project" child pages (could be as few as 1, unlimited number): also normal pages Child pages will ...
2
votes
1answer
169 views

Proper use of the_content filtering

This is a bit difficult without posting scads of code, but my question is: What are the benefits of filtering through apply_filters('the_content', 'anything');, and given my example loop, am I ...
0
votes
1answer
125 views

How to check if this is the nth instance of a given shortcode in a post

Suppose I have a shortcode called [item], which I have used 20 times in a particular post. Is it possible, from within the shortcode handler function, to know what the numerical index of the given ...
2
votes
1answer
544 views

Replacing with(out) regex link to attachment by links to files

I tried to do it myself but I have really hard time with Regex (regex is hell. I just don"t understand). Anyway, I think this would be usefull to some people. The context is that we use a plugin to ...
1
vote
3answers
2k views

Insert Ad Code in the Middle of a Post

I want to insert an ad code in the middle of a post via functions.php. I found several links but either they don't use functions.php or don't insert the code in the middle. Can anyone tell me how to ...
0
votes
1answer
133 views

the_content returns blank when adding SEO details

I am using the Thesis theme and wanted a custom style for my pages. So I created a custom template while using thesis hooks and functions where applicable. I am doing this with a solution similar to ...
0
votes
1answer
330 views

Paginate the_content automatically? [duplicate]

Possible Duplicate: Automatically create pages in a post based on number of words Can Wordpress automatically paginate large amounts of content? A user wants to enter a document that is ...
2
votes
2answers
379 views

Rendering Custom Post Types independently of the theme in use

By using a plugin called "Custom Content Type Manager", I have implemented in my blog a simple Custom Post Type called "game review" which is simple a post, plus some extra fields which represents the ...
0
votes
2answers
644 views

Way to show content of a post, but if exceeds character limit revert to excerpt?

So I am working on a site for a client of mine. We have about 50+ posts filed in a category called "Articles". I created a custom page template that has a custom query to display all the posts in a ...
1
vote
2answers
165 views

Accessing Media/Files outside the_content

I'm building a site and each post has a PDF file attachment. Is there a way I can access that file outside the_content() on a single post page? I'd like to put the file attachment in a sidebar and not ...
0
votes
1answer
744 views

post->post_content filter

I'm trying to determine if the REGEX I'm using is incorrect -- or if I'm missing something basic here. The following: add_filter('the_content','wpdu_image_replace'); function ...
0
votes
1answer
394 views

Force the_content() to show full post in RSS feed

I'm making a custom RSS feed where I want the full article to display. The problem is that when I use the_content() to output the article, it will only show the excerpt if there is a 'more' tag in ...
1
vote
1answer
679 views

add data-attribute to all images inside the_content()

I wonder if it's possible to add a filter to all images inside the_content() to create the following image pattern for all images … <img class="digest" src="smallest-file.jpg" ...
5
votes
1answer
859 views

Using preg_replace to separate gallery from the_content?

In a Wordpress theme, I need to separate a gallery from the rest of the_content. I think one could do that with get_the_content and preg_replace but it's a little beyond my skill level how to actually ...
2
votes
1answer
504 views

Add $more_link_text parameter to the_excerpt()

this filter is on the Wordpress Codex …  add_filter('excerpt_more', 'new_excerpt_more'); function new_excerpt_more($more) { global $post; return '<a class="moretag" href="'. ...
1
vote
1answer
2k views

How to correctly limit the content and strip HTML?

I have been using this code for a long time : $temp_arr_content = explode( " ", substr( strip_tags( get_the_content() ), 0, 720 ) ); ...
0
votes
1answer
276 views

Plugin scans for images in post_content, how about “featured image”?

I use WordPress SEO by Yoast, especially for the Google News sitemap feature. My theme is coded in such a way that the main image of a post is also the featured image of the point (i.e. the same ...
1
vote
1answer
192 views

Removing permalink from post thumb in twentyeleven

possibly a simple thing to do but I'm not sure how it's done - I want to remove the permalink from a post thumb, in the default twentyeleven theme. Looked through content.php and the other templates ...
1
vote
2answers
431 views

Filter the_content() in the Quote Post Format to Display Quotes

I'm customizing a theme for a client and I want to leverage post formats. On the quote post format I would like the_content(); to be wrapped in a two spans that contains quotation marks that I ...
1
vote
1answer
2k views

Add Class to Specific Paragraph of the_content()

Let's say I want to give the first paragraph bold text by adding a body class to the first paragraph. Is there a way to filter the output of the_content(); or any other paragraph? First paragraph? ...
1
vote
1answer
736 views

How to encode post content as JSON?

I`m trying to construct a json object but are having difficulties with the_content since it returns newlines, which causes the script to fail. The error messages received is: Uncaught SyntaxError: ...
1
vote
1answer
824 views

the_content() is not displaying content, why? [closed]

I have a custom theme and have built a blog page where I'd like to utilize "the loop", but get_content() is not working. Instead of displaying page content, it displays code from a template. I don't ...
2
votes
1answer
311 views

Wordpress Wysiwyg Content not being displayed

My Wordpress website really isn't working to how I want?! It was working fine, with nothing being touched, Then lately I find every-page is displaying the same content on each page. Not the ...
0
votes
1answer
108 views

In Loop Output Place Custom Field Content In Between Paragraphs

I'd like to place the contents of a custom field or variable in between the second and third paragraphs in the loop on a page template. Is there a way to do this? So for example, on a client's ...
3
votes
1answer
419 views

WordPress adding <br> tags into plugin content

We've written a plugin that shows reviews upon usage of a shortcode. On some sites, Wordpress is adding <br> tags throughout the shortcode content, and others it does not. The shortcode works ...
0
votes
1answer
405 views

custom field output after the_content

What I want to do is output a custom field content (which is a button with a dynamic link that's being inserted in the value of the custom field of each posts) right after the_content and before the ...
0
votes
2answers
771 views

embed the_content

Im trying to wrap video urls and embed code in a classed div so that I can style it. The vid code is being pulled from the custom meta value I've setup for the video post type. Nothing I've been able ...
2
votes
1answer
117 views

Sanitising post content for use in an email

I'm sending the content of a custom post type in a plaintext email (it's to send competition entries to a panel of judges), so I need to make sure that $post->post_content is correctly sanitised ...
1
vote
2answers
191 views

Combining the_excerpt with the_content

I have some html: <div class="container"> <p class="accent">The first paragraph...</p> <p>The rest of the article...</p> </div> I'd like to put "the_excerpt" in ...
3
votes
1answer
502 views

Custom filter for the_content doesn't work correctly

=====THIS POST HAS BEEN UPDATED===== SCROLL TO THE BOTTOM TO READ THE UPDATE! I asked a question yesterday that a gentleman named Tim was nice enough to take a stab at. He helped me through writing a ...
0
votes
1answer
165 views

How do I assign this filter to a variable? (Appending php & markup to the_content)

===I HAVE SOMETHING THAT WORKS NOW, JUST NOT CORRECTLY. PLEASE READ THE WHOLE POST, I AM GOING TO LEAVE IT ALL UP HERE BECAUSE OTHERS MAY BE ABLE TO BENEFIT FROM ME BUMBLING THROUGH THIS PROCESS!! I ...
0
votes
2answers
253 views

Inserted double quote when prepending to the_content

I am trying to write a plug-in to display the RunKeeper Healthy button on single posts, but my output has an extra space and double-quote when I look at the page source. What I'm trying to do with the ...
0
votes
1answer
232 views

Fixed height of the_content()

I have page with news. I'm displaying them as a shortened text (300 chars limit), I'm removing any images using preg_replace() and everything looks fine, until someone uses line breaks in his post. ...
1
vote
3answers
4k views

Why is the_content() not displaying the content? [closed]

in my wordpress site, the_content() is not showing the content, but $post->post_content shows it, why this is happening? and how can I use the_content again?
5
votes
1answer
445 views

Content over 10,000 characters won't display with the_content()

A friend of mine just noticed that their site wasn't displaying pages that had a lot of content. For some reason they are just blank, and if he removes some content from the page it will display ...
0
votes
1answer
225 views

Problem on the_excerpt(); function <the_excerpt> <the_content>

I am working on wordpress but I have problem when I write the_content('read more'); then on indexpage each post load full data of post but I want to but when I am using the_excerpt(); then ...
0
votes
1answer
95 views

How to parse without changing the characters case (lower and upper) in wordpress the_content?

I made a custom parse function for my plugin and this one works great. I just have a little problem ! Here is my function : public function ys_glossary_parse( $text ) { // Get all the ...
0
votes
1answer
576 views

How to prepend text to the_content, but after img/shortcode

I was trying to add some text to the beginning of every post (the text comes from post_meta, but for this example let's assume it's static text). Here's what I tried: add_filter('the_content', ...
1
vote
2answers
871 views

Hook midway through the_content();?

Basically, I want to add a function that executes half way through the_content(); I want to add a message/ad block whatever in the middle of all of my content without having to go in to each ...
0
votes
1answer
197 views

Adding if statement into the_content()

I've created my own page template where I have a list of posts coming in directly below the content as so: <?php the_content(); ?> <?php query_posts('category_name=vacancies'); ...