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

learn more… | top users | synonyms

1
vote
1answer
332 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
387 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
173 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
3answers
502 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
313 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
680 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
295 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
149 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
760 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
165 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
447 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
137 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
321 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
2k 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
89 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
81 views

Scroll over to get definition

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 ...
1
vote
2answers
217 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
1answer
280 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
53 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> ...
2
votes
1answer
114 views

Modify the_content after the more tag

I have created a custom plugin that pulls video and images out of a post and puts them into a nicely formatted set of galleries. The only problem is that the plugin doesn't allow me to put a video or ...
1
vote
2answers
215 views

How to split <p> text text text </p> into array

I like to output and style in a shortcode, but the content that is get is the content of a page, so it's style like that <p>2012-12-12</p> <p>2012-6-23</p> ...
2
votes
2answers
1k views

How to to stop html editor from addig <p> tags to shortcodes, images, etc

I know this this is covered as individual topics but What I am looking for is a single function that stops <p> tags from being wrapped around via the Wordpress editor to shortcodes and images ...
0
votes
2answers
154 views

how to place a link on the first post only using a plugin

i want to add a link to the first post of every WP blog that i have. For example this simple function adds the link to every post. function add_link($link){ $link .= '<a ...
0
votes
1answer
66 views

Stop WordPress from showing images on non post pages

With regards to how WP displays "preview" text on the home page, category page etc for each post, how do you stop it from including images in this section. I'm not talking about the featured image ...
2
votes
4answers
3k views

Modify 'Read more' link adding a new class

I want to add a class to the 'Read more' link. Actually I have this: <?php the_content( 'Read more...' ); ?> Which outputs: <a href="...?p=14#more-14" class="more-link">Read ...
1
vote
1answer
168 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
803 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
222 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
75 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
146 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
235 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
1k 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
89 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
2k 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
613 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
315 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
145 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
109 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
477 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
121 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
308 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
350 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
576 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
161 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
685 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
355 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
613 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" ...