Tagged Questions

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

learn more… | top users | synonyms

1
vote
3answers
863 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
124 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
203 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
529 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
183 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
266 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
239 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
5k 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
472 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
235 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
99 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
614 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
930 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
202 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'); ...
1
vote
2answers
2k views

What is the filter hook for custom fields content?

The following code hides "the_content" output add_filter( "the_content", "cp_module_pcontent_post_content" ); function cp_module_pcontent_post_content($content){ global $post; ...
4
votes
2answers
10k views

Get content from one page and show it on another page

So, I've been googling and reading and testing and failing. I'm fairly new to php, so don't expect to much :) I'm working on a new design, and I want to show content from the about page on my ...
-1
votes
2answers
1k views

shortcode causing the_content() to return blank?

I have a shortcode that just retrieves some info from the options table in the database. For whatever reason, when the content reaches a certain character limit the_content() to return blank? The ...
0
votes
1answer
393 views

Wp-query causing problems with the_content();

I'm using some code provided in an answer on here to calculate "post X of Y" and display pagination icons on single.php. It works beautifully but it's causing problems displaying the_content(); On ...
2
votes
1answer
72 views

Template Page Content Made Searchable

I'm migrating a client site over to a WordPress CMS. I made templates for each of the pages that would have static content: about us, facility, FAQs, etc. The problem is that this content seems to be ...
0
votes
2answers
3k views

How to access & display images from a post without textual content ( and vice versa) according to best wordpress practices

Looking to create a customized single.php for my posts. In one column I'd like to display all images added through the add media function (inserted into post). In the next column all other content ...
4
votes
1answer
4k views

why doesn't the_content() work in this {single-custom_post_type.php} page?

This code is from my page single-publication.php. It outputs the relevant custom fields etc (here wrapped in template tags), but the_content() won't output the post content. I've resorted to using ...
4
votes
1answer
4k views

How to appending to the_content using add_filter with custom post type?

I have a custom post type running fine, but some of the text in the page is the same for every post, so I want to add it in using a function. I have this set up: function ...
0
votes
1answer
3k views

add_filter for specific pages

Is it possible to add this filter add_filter("the_content", "magicalender_get_event_page"); But only for one specific page, for example if($post->post_name == "magicalenderpage") If I put the ...
0
votes
1answer
303 views

Help with add_filter('the_content', 'some_function') and multiple matches

I have a site where a user can insert slideshows into a post by entering the shortcode in the content box. He can also add videos by adding the video code in the same box. I need to separate these two ...
0
votes
3answers
705 views

how to include page content to specified length & then “read more” link

I'm pretty new to WP, so please forgive any stupid questions and/or coding! I'm using the following code in my index.php file to include content from another page: <div id="tm-container"> ...
1
vote
1answer
542 views

Adding the_date inside <p> tags around the_content

I am trying to get it so that all of my posts display the date at the beginning of the post content, such that each post begins as: "August 28 - Lorem ipsum dolor sit amet..." However, if the ...
0
votes
2answers
2k views

How can I remove filters from custom post types?

I created a custom post type which I'll use as landing page for PPC. Now on that custom post type I would like to remove all the filters which are adding the social media buttons for example. I tried ...
0
votes
1answer
201 views

The_content display a different content from a previous loop

I have custom template for my homepage. If i just put the_content(); to this template, nothing else, then it will display my text i entered in my admin panel in the editor. But if i have a different ...
0
votes
1answer
387 views

WordPress appends the_content filtered text inside last paragraph tag of content (rather than after it)

Using WordPress version 3.2.1 I've noticed that when I use this filter: add_action('the_content', 'myFunction', 0); The content editor places the content written from "myFunction" within the last ...
0
votes
1answer
529 views

Problem in replacing the_content with the_excerpt()

I want to add read more to a blog. For that I need to replace the function the_content(). I found it in the loop file and replaced it with the_excerpt() but still posts are being shown of full length. ...
1
vote
3answers
678 views

Finding the paragraphs in content

I am trying to create two functions, one that catches the first paragraph of some content, and one that catches the rest, but I have hit a bit of a conundrum. I have this in my single.php: <div ...
0
votes
2answers
2k views

Get the Page Content,without generating HTML

I want to get the page content (so i can parse the tags/short-codes in it), but i don't want to output the result itself to the browser (i.e. echo=0). I tried get_the_content(); but its the same ...
0
votes
2answers
993 views

Giving the_excerpt in the place of the_content?

Short and sweet — I wanted to deliver up the excerpt of a post in the place of the_content on certain pages. Naturally, if no excerpt is present one would be generated from the content. I ...
2
votes
1answer
959 views

the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”

Before I call the_excerpt(), the_permalink() displays the correct thing. Afterwards, it does not... <?php global $query_string; //strip out the ...
1
vote
2answers
9k views

Adding a div class or id inside the_content()

I'm trying to create an advertisement block to be placed on a single post (single.php) such that the div class or id is left aligned and the post content wrapped around it. I checked the single.php ...
0
votes
1answer
838 views

How do I pull excerpts from pages?

So I enabled custom excerpts on my pages with this function. add_action('init', 'page_excerpts'); function page_excerpts() { add_post_type_support( 'page', 'excerpt' ); } However, When I enter ...
-1
votes
1answer
917 views

Get link value only from the_content()?

I have my news in posts and I am trying to display the two latest news articles (posts) on my main page. I've got that solved by getting the title using the_title() and getting a little bit of the ...
2
votes
2answers
2k views

What params are available with the_content filter?

I am looking for what params are passed to my filter function. Where can I find such info in the codex? http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content didn't provide much info I ...
1
vote
2answers
2k views

Content/Excerpt length control for a specific loop?

Is it possible to control the length of the content or excerpt for a specific query/loop? I have come across the following code, but this changes the length for all excerpts, I want it focused on a ...
0
votes
2answers
1k views

Best way to strip the_content of html on the front end?

What is the best way to strip *the_content* of html tags and needless spaces on the front end? I'm building a special use theme that needs to allow users who can edit_post to make changes on the front ...
1
vote
2answers
377 views

the_content is always surrounded by paragraphs (how to disable or remove them)?

the_content is always surrounded by paragraphs, it doesn't matter if I'm in HTML view and there's nothing there. Does WordPress have a function to remove them? IS there any way?
2
votes
1answer
682 views

Add span to the first letter of post

Example post <p>Lorem ipsum dolor sit amet</p> <p>Morbi elementum odio vel tortor adipiscing vel tempor risus ullamcorper.</p> What I have done : function ...
18
votes
9answers
12k views

Stop Wordpress Wrapping Images In A “P” Tag

I have searched high and low for a simple solution to this, but to no avail. Wordpress keeps on wrapping my images in p tags and because of the eccentric nature of the layout for a site I am working ...
0
votes
2answers
454 views

How to add multiple the_content or something like that?

ok... let me explain: i have an example post in wp admin and i want to add : some text (already added via the posts editor) some custom stuff (some taxonomy that i have already added) some videos ...
0
votes
1answer
2k views

How do I show current post content in the header?

I'm trying to add the post content in the header but for some reason it doesn't show anything. However it does retrieve the post content. I wrote this: <div <?php post_class() ?> ...
0
votes
2answers
215 views

append_content help

i have a function in my plugin append_the_content($content) this is used to display my function inside the post, but it is coming before the post, i want to make it after the post, for this i tried ...
1
vote
2answers
814 views

How to apply content filter permanently?

I have the following temporary filter to fix a content error. We have data in our posts that have 4 digit zip codes, because the leading zero was cut when the original file was created. (For instance, ...