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
0answers
50 views

Best way to handle Post-Format Video without using the_content?

I have read the Codex and I'm about 3 hours searching around sites for a deep understanding of post-formats but got no answer. Don't know if it is a dumb question but after spending a long time ...
0
votes
1answer
335 views

post_content with line breaks

I want to be able to get post_content with line breaks. What is the best way to do it? I previously use the_content() which was working fine until I needed to install a plugin that adds share buttons ...
0
votes
1answer
62 views

the_content() won't load galleries on homepage

I need to show a gallery that's on the content of one of the pages I'm displaying on the homepage (I altered the query so it would display pages instead of posts). If I open the page directly I can ...
0
votes
1answer
91 views

Add Element as a Filter to the_content

Can I and How would I add a filter in the function.php that would add a HTML element around the content when the_content is used? This would be similar to what you can do with the_title. i.e: ...
0
votes
1answer
114 views

how to use custom loop in the_content filter

Trying to use the the below code for my CPT 'state' like add_filter('the_content', 'my_custom_loop'); but the trial and error is not getting me anywhere. I can't use a single-{post_type}.php since i ...
0
votes
0answers
347 views

List posts in a select tag and display the_content of the selected option

I would like to create a select tag with posts from my custom post type and then, when an option is selected, I need to get the_content() from that selected post by its ID and display the content ...
0
votes
0answers
95 views

Split the content of single.php by more tag and split texts and photos

I am trying to sprit the_content() by more tag. But I cannnot think of how to write the code for the photos(images) before and after more tag. Photos exists none or more by the post. If anyone know ...
0
votes
1answer
708 views

apply_filters('the_content', $content) alternative

"the_content" filter can get added with other filters from plugins and themes which could alter content, when you simply want this to format the post_content to HTML format. Is there a better ...
1
vote
1answer
74 views

How to ensure “the_content” filter runs only for the main displayed content?

I have a plugin which adds the method to "the_content" filter. add_filter('the_content', 'myFilteringFunction', 10000); Within that function I want to add some links on the beginning and the end of ...
0
votes
0answers
53 views

Add class to all parent elements inside the_content

Is there a way to add a class to all parent elements inside the_content? My problem is I'm using this kind of css selector: .post_content>* {margin-bottom:10px;} This is to due with mostly ...
0
votes
2answers
160 views

Can i use multiple 'the_content' filters?

I am currently using a 'the_content' filter to add some HTML to the bottom of my posts and pages. But, I want to add another 'the_content' filter to a handful of specific pages (using page IDs). Is ...
0
votes
2answers
433 views

How to filter the_content() & include content from template

I am trying to filter the_content() on single page, but it looks like it is creating an infinite loop. I want to know how to fix this. I want to override the_content(). Is there any other way to ...
0
votes
0answers
20 views

Modify images when inserted in to WYSWYG Editor

When an image get added it currently adds <a href="www.domain.com/image.jpg"><img src="www.domain.com/image.jpg" /></a> I am aware that user can directly add the link. However the ...
0
votes
0answers
55 views

the_content not including blog image URLs

I am using the jQuery Image Lazy Loading Plugin on my WP 3.3.1 blog, however I have found that the_content does not include the image URLs, so the preg_replace that this function does cannot find any ...
0
votes
2answers
184 views

put the content of a single post into og:description

I'd like to have the content of the current single post loaded into the og:description meta property - but the '. $content .' doesn't output anything? This is what's in my header.php if ...
1
vote
2answers
282 views

WordPress replacing all line breaks in comments with “rn”

This concerns a problem at my blog. My provider recently required me to upgrade from PHP 5.2 to PHP 5.4. This in turn required me to update WordPress. Ever since the dual update, all line breaks in ...
1
vote
1answer
448 views

How to change the position of Jetpack sharing icons? [closed]

Typically Jetpack sharing buttons target the single page's the_content() function and echo the sharing icons just below the content. But for my site, I actually want it to Disable for the_content(), ...
1
vote
1answer
166 views

Remove specific shortcode from get_the_content()

I have a variable like this: $post_content = get_the_content(); Here i want to remove some specific shortcode from the $post_content variable e.g i want to remove only this [video height="300" ...
0
votes
0answers
72 views

Removing image dimensions from `the_content`

I'm looking to remove image dimensions from the_post_thumbnail, as well as the_content. I've found the following code, but there's a slight issue: add_filter( 'post_thumbnail_html', ...
0
votes
1answer
116 views

How can i specify the size of the image rendered by the_content();?

I can do it manually like this: echo get_the_post_thumbnail($post->ID, 'large'); But how can i set the size of the image rendered by the_content(); to Large too ?
0
votes
0answers
38 views

more tag not recognized but content is truncating

Specifying truncating posts of category 'news' on homepage. Trim works but not recognizing the <!--more--> code in posts... from homepage. code in homepage ...
0
votes
1answer
175 views

change the_content images for different sizes (Desktop, tablet, mobile)?

This may be a complicated question so I'll try to explain it as easy as possible. I have three sizes for images in my post (thumbnail, medium, large, 640px, small) and I would like to change the size ...
1
vote
2answers
266 views

Filter to change the content of 404 page

I have created custom rewrite rules. These rules now go to 404 page as expected. I can use action hook template_redirect to change the template matching query_var. But I don't want to create separate ...
0
votes
0answers
52 views

Is it better to use filter for the_content in archive pages?

I'm using advancd-custom-fields plugin and I'm about to modifiy my acrhive content page that is shown frontend. I use the file personnel-archive.php (because the custom post type used is personnel) in ...
0
votes
1answer
55 views

What happens when two or more plugins use the same hook?

Two of my plugins use the same filter hook: the_content. What happens in this case? Is there a priority handler, like which plugin will be served first? I would like to use both of the plugins. I ...
0
votes
2answers
63 views

Content won't load when using action the_content

When I use add_action( 'the_content'... The content of the page just won't load. Also the content I am trying appears in all kinds of places in the page. Why? Is there a way to force it to only ...
0
votes
1answer
55 views

Is it possible to change the contents of “the_content()”?

I have moved a blog over to wordpress and I've used a lot of DOMDocument, xpath, regex and other methods to scrub the text. This means that the_content(); is no longer the content and I'm using my ...
0
votes
1answer
212 views

the_content() “crashes” for single pages

I have big trouble with the_content() for single.php. Whats my problem? the_content() doesn't give any output on single pages furthermore it crashes (no other PHP code below the function call is ...
1
vote
1answer
54 views

Plugin Using get_the_content Causing Issues With <!--more--> Tag

I'm testing out the Woothemes "Our Team" plugin to see how it works for future project purposes. The plugin uses at CPT for Team Members as well as a shortcode to allow users to display members on a ...
0
votes
1answer
48 views

Have multiple loops on a page appear after/between page content

I created a function (in function.php) that allows me to put additional loops for different categories into pages: function custom_summary($atts) { extract(shortcode_atts(array( ...
0
votes
1answer
27 views

IF Inside A Function For Content Filter [closed]

Trying to use a filter for post content. But how do i make an IF work inside the function. <?php function my_the_content_filter($content) { } add_filter( 'the_content', 'my_the_content_filter' ...
0
votes
0answers
61 views

Suppress the_content filter in a nested loop

I have some layout changes that are being applied to the_content. I need to do one of two things, but neither is working as expected... either: Pass data to the filter so that it knows if it is a ...
-1
votes
1answer
123 views

Find and replace weird characters in the_content [closed]

So, I am using the following code to filter out certain letters. $phrase = get_the_content(); $phrase = apply_filters('the_content', $phrase); $replace = 'ï'; echo str_replace('ï', $replace, ...
0
votes
1answer
74 views

Sort appearence order in the_content()

I have an About the Author plugin, echoing inside the_content(), and a Facebook Like Button, that I hardcoded in the HTML, after the_content(), here's how it is outputting: The Facebook Like button ...
0
votes
3answers
90 views

content and excerpt not displaying

I am using get_the_title(453) and while the title displays, i am unable to display the content and the excerpt for the page with the id of 453. The following is my code get_the_title(453); ...
5
votes
3answers
2k views

Split Content and Gallery

Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode ...
0
votes
3answers
57 views

how to print the content of pages inside the front end area

i'm new to wordpress and i'm trying to create a website. i need display the content of the pages when corresponding menu items are clicked. my page.php contain <?php while ( have_posts() ) : ...
2
votes
1answer
73 views

preg_replace Remove comment text in content

In post content, i insert a text like below abc acb acb acb <!--REMOVE--> text to remove <!--ENDREMOVE--> abc acb acb acb abc acb acb acb <!--REMOVE--> text to remove ...
0
votes
1answer
35 views

How accomplish modification the_content if home/start page?

How can I modify the_content if the page is the home/start page? I thought this could be done through a function in functions.php, but soon realized after some googling that the functions.php -file ...
0
votes
1answer
121 views

alternative to the_content filter

"i am using the_content filter on the category pages like cat=1" I am appending --N in the content. But due the the theme functionality it strip the content after some number of characters therefore ...
0
votes
1answer
24 views

Get Content Limit?

I know this might seem like a silly question, but I've searched online and can't find what I"m looking for. It seems like I've used the following markup before (though modified) to limit the number of ...
0
votes
1answer
47 views

how to change automatic placing of social plugins below content?

I'm wondering if it possible to change the automatic place below the_content() function; this is becuase I`m displaying custom information fields, but activating the social plugins which have not it´s ...
0
votes
1answer
95 views

filter on the_content stopped working when I updated to WP 3.6.1

I created a filter to add a pin button on to my blog posts' images, which after much playing worked. Then, a few weeks later, I updated to 3.6.1, and the filter stopped working. Did something change ...
1
vote
1answer
830 views

Get the_content with ajax

I'm using WordPress (WP) as the backend for an app that delivers content on a map. I've been trying for a couple of days to get my head around AJAx in WP and have found a good tutorial I'm trying to ...
0
votes
4answers
410 views

Output the_title() inside the_content()

I'm sure this isn't possible but thought I'd ask. I have a testimonials section, the html of each testimonial is like so <p> the testimonal here blah, blah, blah, blah, blah, blah, ...
1
vote
3answers
658 views

Divide Post content into separate divs for every 500 characters (or any other character counts)

What is the best method for intercepting the_content of a post (for a single post page) and dividing the_content into sections of 500 characters (or any other number of characters), and then ...
1
vote
1answer
377 views

Post Content, Special Characters and Filters

I added a hook to the_content. add_filter('the_content', 'edit_the_content'); function edit_the_content($content){ return $content; } Pretty simple right? However, when it output $content from ...
0
votes
2answers
2k views

remove <p> tags from the_content

I've got a post format of Image, and I am running into an issue where the image is being wrapped by a <p> tag. I want to get rid of that tag (specifically on the single.php version) of those ...
0
votes
2answers
389 views

If is_single in functions.php

I want the remove wpautop filter working only on posts from my blog. Because at some pages i need the autop, and at some pages i need it to not be there. I use the following rule and it is in my ...
0
votes
0answers
684 views

The Loop won't display page or post content

I can't get the page content to appear in my custom wordpress theme. I have an extremely simple version of The Loop, which should just display the title and the content of the current page or posts. ...