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

learn more… | top users | synonyms

2
votes
1answer
104 views

What functions are included in apply_filter('the_content')

There is a function called apply_filter where you can use it like this: echo apply_filter('the_content', $my_content); It add formatting tags and clean up the content. Trac or docs I looked in ...
0
votes
1answer
284 views

the_content not working on one of two Multisite sites

I have a multisite with two subsites (sub-domain setup) both sites have the same theme, same plugins but the first one is in Hebrew and the Second in English. On certain templates (not all) in the ...
1
vote
2answers
186 views

Output 2 items within the Loop

I have a query that loops through <li>'s and displays the number of <li>'s I have. Is there a way I can make the loop pull 2 <li>'s at a time rather than one? // 5 list items ...
0
votes
2answers
272 views

Strip <p> from <blockquote> or something better?

Looking for some help on something that has me really contemplating not using blockquotes for the moment! I have this code: <?php $show_after_p = 1; $content = apply_filters( 'the_content', ...
0
votes
1answer
190 views

How to hide <pre> and <table> content from auto-generated excerpts?

Auto-generated excerpts just take the first x characters from the post content and cut that off at a certain point. When there is a table or pre element in that part, the excerpt looks rather useless ...
2
votes
2answers
3k views

How can i remove all html tags from get_the_content()?

i want to remove all html tags from content like <p>, <br>, <img>, <a> i tried strip_tags() also tried $content = get_the_content(); $content = apply_filters('the_content', ...
0
votes
2answers
2k views

Static page homepage not showing the_content

I must be doing something wrong here. I setup my site with a static front page using front-page.php. I created a page in the admin with a title and chose the front-page.php in the template dropdown. ...
2
votes
1answer
158 views

Display the Content of a Post with qTip2

How would/should I use qTip2 to display the the_content(); of a WordPress post? I've been trying to accomplish this for a month now. I got it working once, but it wouldn't display the content that ...
1
vote
2answers
2k views

Removing any and all inline styles from the_content()

For one of my current projects, I had to transfer blogposts from an old Wordpress site to my project. Things went smoothly until I've seen that all the posts were copy pasted from Word, leaving this ...
2
votes
3answers
374 views

How to show video from specific category on sidebar?

I need to get video and content from recent posts in specific category called "Video" and show it on my sidebar. The problem is when I need to have limited text content. so, when I use the_content(); ...
-2
votes
1answer
30 views

How to build or store lots of custom content

I'm setting up a new WordPress site and going forward we are going to be building a lot of custom interactions that will need to be stored within WordPress. When I say custom interactions I'm talking ...
-1
votes
1answer
658 views

Add read more to the_content

Hi I have a custom post type that i've truncated on the archives pages using this: function limit_the_content($content){ $word_limit = 35; $words = explode(' ', $content); return implode(' ', ...
1
vote
0answers
208 views

Can I insert the feature image inside the content, after any paragraph?

I want to display the feature image inside a post text, perhaps after the third or fourth paragraph (or any) into the_content. Searching the site I've found this code, by Amit: ...
0
votes
1answer
167 views

filter the_content, custom post type, and wp_query

I thought this was going to be quick and easy, but naturally it's turning out to be more complicated. I'm writing a simple plugin that creates a custom post type "Ad", and then puts a random ad at ...
0
votes
1answer
159 views

pre_get_posts returning unformatted page

I ran a custom loop the other day to get some twitter information. Since I was running the code in a template and that template was being called from another loop, I was able to get the template data ...
0
votes
1answer
106 views

Append data to the_content within the database (not using filter)

My site requires that people can search for terms that are included in tags and categories (towns and counties). I'm having some resource issues using the 'Search Everything' plugin, it's causing the ...
0
votes
1answer
159 views

Is it possible to remove next-post / previous-post with out creating a custom template?

I'm creating a plugin that uses a custom post type. I do not want to make a custom template for viewing the posts and discovered I can add a filter for the_content to include my custom fields, this ...
2
votes
1answer
313 views

<p> tag the_content()

I'm trying to configure my content-page.php but i'm struggling with a few 'mistakes'. <article id="post-<?php the_ID(); ?>"> <div class="page_content"> <h1><?php ...
5
votes
1answer
111 views

Add whitespace between Chinese and other letters

I want to add a space between a Chinese character and a letter or a number to make the article more readable. For example: Google与Apple展开的专利大战在2天之前结束。 Google 与 Apple 展开的专利大战在 2 天之前结束。 But ...
-1
votes
1answer
848 views

How can I add multiple content-editable blocks without a plug-in?

I'm using WP as a CMS, not a blog. I have a lot of pages (not posts) that need to have different content per page in the sidebar. The content (html, images, php) in the sidebar will be different ...
0
votes
1answer
315 views

Why does apply_filters behave different inside and outside a loop?

What I want: the array of posts returned by creating $query = new WP_Query($args); Why: to return specific content as a sort of API request in json format, ready to display on another site What I ...
1
vote
1answer
988 views

Split the content of the_content();

I want the content before the <!--more--> tag in one column and the rest in another column (single.php) only. I don't want to use plug-ins where I would need to edit all the posts to get it as ...
0
votes
2answers
172 views

Replace full content with an excerpt

My theme shows full posts on the main page and I want it to show only the summary, I tried searching for the_content tag in my theme's index.php file but it is not even there! I don't have a home.php ...
1
vote
1answer
521 views

the_content() isn't showing content, but $post->post_content does

I'm trying to echo the content of a single post by using the_content(); but I get an empty result. However when I directly address the global $post, and specifically the post_content property it does ...
6
votes
2answers
280 views

WordPress Internal @ Mentions

I'm looking for a way to link to author pages within one WordPress install simply by putting the @ symbol in front of a person's username in a post.... just like on twitter. Example: If the username ...
0
votes
1answer
74 views

Can / should a widget plugin define its own Widget Area?

Should a plugin be able to add a widget area above the_content? (Without requiring template/theme changes.) What would be the best way to do this? Doubts: widgets typically echo output to the screen; ...
0
votes
1answer
209 views

Conditional function for excluding first image from content, not working

I have the following function: function remove_images( $content ) { if( ( is_category() || is_archive() || is_home() ) && has_term( 'MyCat', 'category', $postID ) ) { $postOutput ...
0
votes
1answer
126 views

How to disable the_excerpt from one post

I have this code for the_excerpt : function get_excerpt(){ $excerpt = get_the_content(); $excerpt = preg_replace(" (\[.*?\])",'',$excerpt); $excerpt = strip_shortcodes($excerpt); ...
1
vote
2answers
50 views

Adding a form at the end of the content

I'm trying to add a little form after each post for a plugin I have to code, but I'm not very familiar with Wordpress. By using add_action with the_content as hook, I was able to add some text to the ...
1
vote
1answer
396 views

Appending code to the_content

I'm trying to append some php code to the_content in a custom loop. I do not want to add a function because I only want to append the code to one instance of the_content, not throughout the whole ...
0
votes
3answers
570 views

How to limit the characters shown on the page - get_content

I've the below php to display the content of the post id#9 on my 'home page' of my site, so that whenever the client updates the page, it's reflected on the homepage as well - rather than having to ...
0
votes
1answer
29 views

This Wordpress plugin isn't creating links correctly

To get my PHP and Wordpress skills, I've been trying to code a small plugin a day. Today's project was to create a plugin that searched over every word in my posts, checked if ...
-1
votes
2answers
208 views

Get URL from shortcode tag

I am running a wordpress site and I need the correct regex syntax to get a URL from some shortcode that is returned inside the_content(). When I use the_content(), it will return something like ...
0
votes
2answers
1k views

Stop wordpress from adding html tags but not remove my own tags?

I've been trying to make wordpress stop adding html tags to my content but leave my own html tags alone? Tried remove_filter( 'the_content', 'wpautop' ); and installed PS Disable Auto Formatting ...
1
vote
4answers
683 views

How to add an inline style to the <p> tag outputted in the_content() using PHP?

I am trying to add an inline style to my paragraph tags which are ouputted using the_content(); I've tried string replace, see question I did earlier. But it won't because the_content echo's it and ...
0
votes
1answer
442 views

add_filter to the_content after apply_filters

I have a shortcode that outputs null (""). What I'm trying to accomplish is to output a default message if the shortcode outputs null. I don't want to extend my shortcode because there may be ...
-3
votes
1answer
918 views

How I can show short content with short tag

I am using wordpress I want to show ** short content with limit ** of wordsfor every post on home page for this I am using this code functions.php function abc_the_content($num_words) { ...
0
votes
2answers
369 views

Extract a link in the_content()

I'm trying to improve a bookmarks manager/theme I've built (http://bookmarkie.waterstreetgm.org). Right now, each post is simply a link: <a href="http://tumblr.everlane.com/page/4">Everlane ...
0
votes
1answer
192 views

Links in the_content not linked

I have alot of old posts that are being pulled with the_content() context. In the_content() there is links in the text, however none of them are hyperlinked it just shows like ...
0
votes
1answer
1k views

How to limit post content and remove image caption from it

I am using this function to limit the content in my themes. But the problem is whenever I call the function, it also displays the image caption. I want to remove the image caption when calling ...
0
votes
1answer
183 views

how can I get seperate the HTML in the_content(); output?

I want to be able to seperate the first image form the post into a <div> tag and link it to the post page and be able to add html around the post text elements seprately. Any help is greatly ...
1
vote
1answer
555 views

Exclude the_content (); from page password protection

I use a page template to show custom post type. All content from the custom post type should be password protected. I´d like to use the wordpress editor for some additional public information. Can I ...
1
vote
1answer
177 views

Loop after page content

I just upgraded to 3.4.2 from 2.9 (i know, i know, but if it ain't broke...) I have page templates that are (or at least were) set up to display the page content first, then start a loop of posts, ...
1
vote
1answer
459 views

Nested calls the the_content filter

I'm writing a plugin that adds some custom content near the end of a post (or page). So I've added a filter for 'the_content', and the plugin adds its content there. Mostly, it works. However, some ...
2
votes
2answers
4k views

limit the words in the post content and add read more link

As you can see into the code, the routine is to display the post which has an id of 266. Now all I want is to limit the words displayed in the post content of that post. Let's say, I want to limit the ...
1
vote
1answer
99 views

Single post content custom order

In my post I have a shortcode for [video] than text content. Single post page displays first entry-meta, than title, than content [video] + text. What I need is to add some condition in single.php so ...
-1
votes
1answer
104 views

Scroll over to get definition [closed]

I need to have content appear when I scroll over certain words or groups of words. Eg. If I scroll over the word pastor. I should see a definition of Pastor appear next to the word.I would like to ...
2
votes
2answers
294 views

Testing for post title in 'if/else' statement returns no content

I'm testing for a certain fixed post on an about page, I guessed that the best way is to test for post title (?). Here's my code, what's going wrong? <?php if (is_page()) { ...
0
votes
2answers
394 views

get_the_excerpt() not returning anything when post has no excerpt

When trying to call get_the_excerpt() the page does not return anything on posts that have no excerpt. I thought WordPress usually 'fake' it and create one using the first x characters from ...
0
votes
1answer
56 views

Post Format Link Validation Error

For link post formats to appear in my archive.php I'm using the following code: <a href="<?php echo wp_trim_words( get_the_content(), 100 ); ?>"> <?php the_content(); ?> </a> ...