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

learn more… | top users | synonyms

1
vote
3answers
89 views

get_the_content not working in loop?

I am trying to modify my loop to save post data by category. I found some code on this site that saved the post's titles based on their categories and tried to modify this to save the post's content. ...
1
vote
1answer
56 views

Filter only the text in the_content

I tried to filter only the text in get_the_content for my home page, but its including my shortcode also, because in that page first row google map 2nd row text box i am using visual composer page ...
0
votes
1answer
30 views

the_content not showing responsive image attributes srcset or sizes

I'm using WordPress 4.4.2, but am unable to get the new responsive images functionality to appear for the_content. It works for featured images, just not the_content images. I have no plugins ...
3
votes
1answer
42 views

Apply the_content filter for specific post types only

I'm trying to modify a snippet of code I found here for a wordpress website: http://support.membermouse.com/support/discussions/topics/9000007386 Here is the code: <?php add_filter( ...
-1
votes
0answers
27 views

the_content() does not work (or is empty) and I can't figure out why

I have a custom page called "Downloads". On this page I have the following code: <main class="site-main" role="main"> <?php if ( have_posts() ) : while ( have_posts() ) : ...
0
votes
0answers
21 views

pre_get_comments or the_content filter

I am learning wordpress deveplopment. I have a litle problem for understand how to use the right hook for add my code. In this case I have to ask... what is the best practice for show social icons ...
0
votes
3answers
21 views

WordPress Load Only Page Text

I'm working on a page template and I need the_title to be separate from the page text. I'm not sure how to load the_content without it having the title. Can anyone help?
0
votes
2answers
42 views

Display specific page (that is child) content on parent page

I have problem displaying child page content on parent page (both static). I can display other page content but only if on same level. It dosent work in relation parent - child. <?php ...
0
votes
1answer
28 views

Using shortcode to stop post content from displaying

Is there any way to use shortcode to block the display of the post content? What I want is to use the shortcode to pull the post content directly from the database, manipulate it, and then display it ...
0
votes
1answer
31 views

How do I set the content for a post of a particular CPT?

I have a CPT called Contest. When a contest is created or updated, I want to manually set the value of the post content to my shortcode from my plugin. I have custom metaboxes that I use with this ...
-2
votes
2answers
34 views

How to remove only images from the_content() [duplicate]

When I call the_content(), I want to show only text and don't want to show images. Notable that, I don't want to remove text style. The text style should be display as well. How can I do this?
0
votes
0answers
26 views

WP_Query pulling all content even with readmore

I'm using a plugin called quicksand that is working for the most part. It hasn't been updated in 2 years though so support there isn't an option. I just noticed though that even though I'm putting a ...
-3
votes
1answer
34 views

Create a shortcode to display the “the_content ()” in my post [closed]

I should create a shortcode to display the contents of the post in my template. Could someone help me? I made a shortcode to display the form of comments, this just can not unfortunately. Thanks ...
3
votes
3answers
122 views

Get random custom-post-type post to display within content

I have a function, within functions.php (all code below), that adds an advertisement after x amount of paragraphs to any given single.php post. I have a custom-post-type called advertising that has a ...
-1
votes
1answer
38 views

add_filter adds output in the head

I build plugin and I have a problem I add to plugin: add_filter( 'the_content', myFunction); function myFunction() { $options = get_option('myPlugin_settings'); if ...
1
vote
0answers
22 views

the_content filter on some post types only not working

I'm using a filter on the_content to insert an ad after the first paragraph of a post and it is working fine. But I'm also using a plugin called Live Blogging Plus and it uses a post type called ...
0
votes
1answer
42 views

Strip links from the_content

I'm trying to strip all the a href tags from the_content(); when displayed on the front end. If I use get_the_content(); and preg_replace it works fine, however, get_the_content doesn't show ...
4
votes
1answer
102 views

Change appearance of shortcode text inside editor

Is it possible to change appearance of shortcodes in editor or in whatever way make it more distinguishable from surrounding text? For example if the content of a post is like this... Reference ...
1
vote
0answers
30 views

Adding the_content() in custom template email

Let my explain the scenario first: I have a very custom page template. That is use in combination with a CPT and a few Custom fields. The CPT is called "werklijsten" (it's in dutch so bare with me) ...
1
vote
1answer
48 views

Displaying recent post excerpts on static front page

I'm trying to display a static front page with recent posts at the bottom. Specifically, I want to display just an excerpt from the recent posts, as would be returned by the_content() if I had a ...
0
votes
1answer
30 views

custom page with post content using read more

I have a code for a custom page i'm creating that I want to have my own blog archive (formatted customized) this is my code: <?php ...
4
votes
2answers
102 views

Using variable from one filter in another filter

I have a filter for the Gallery Shortcode where I grab IDs for images used in a post and using the IDs I grab their meta data. Now I need a way to use the $copyright variable in a filter for grabbing ...
0
votes
1answer
30 views

Create a Wordpress shortcode using PHP [duplicate]

I am currently using the following code within single.php (after the_content) This gets the store_name from custom field as $merchant from the post and then returns a list of products from that ...
2
votes
2answers
93 views

Automatically insert php function into post $the_content

I am trying to have 2 php functions automatically inserted in every post for my CPT. The problem I am having is that even though I've found a way to add text, Im not sure how to add the php functions ...
1
vote
2answers
58 views

What is the proper way to get contents of a page?

The goal is very simple - to print page content on a page. I tried: <?php the_content() ?> <?= get_the_content() ?> then <?php the_content(get_the_ID()) ?> <?= ...
0
votes
1answer
18 views

How to best adjust images to a max content width of 490px?

On a large blog with thousands of images there are posts published by people who do not know much about image optimization. I am searching for a plugin or even a simple wp_content filter function in ...
0
votes
3answers
69 views

The Content is not Wraping in <p> tag

Can you please take a Look at this page (please hove over the image to see the paragraph) and let me know why the the_content() is jumping out of paragraph tag? echo '<p style="color:#fff ...
0
votes
0answers
25 views

Problem with the_content() and &nbsp

So everything looks normal when I type something in my WYSIWIG, it get outputted by the_content() on the page like this: But when my colleague does the exact same thing, it does this: Every word ...
2
votes
3answers
229 views

How to disable content pagination?

I want to totally disable this functionality from WordPress because I'm implementing my own version of this with Javascript. When I try to grab all the content in a post via the get_the_content() or ...
0
votes
3answers
97 views

Add review box by function at top or bottom of content

Filter add_filter( 'the_content', 'sandy_posts_filter' ); function sandy_posts_filter( $content ) { global $post; $review_box_pos =get_post_meta( $post->ID, ...
1
vote
1answer
69 views

Modify Image Source With The_Content Filter?

I'm very inexperienced with regex, however I'm trying to create a function that filters through the_content() and get_the_content() in order to modify the SRC of all images. The intended purpose ...
0
votes
1answer
98 views

Add caption functionality to custom WordPress theme

Hi I am working from a custom theme created by my predecessor and I am trying to add caption functionality to the theme but I am have some trouble with it. Presently if I insert a image into a post ...
0
votes
1answer
53 views

the_content() keeps repeating itself

I'm new to Wordpress and am having trouble getting my loop to make the_content() not repeat itself. I've tried writing multiple loops as well to no avail. I mainly just want the_content() to iterate ...
0
votes
1answer
32 views

How can I get the default content of WordPress post?

Is there a way where I can get the default output of the_content in WordPress post? Some of the plugin is using add_filter to the content to add their desired result like related post plugins where ...
0
votes
0answers
61 views

How Can the_post Be Hooked Like the_content and the_excerpt?

My plugin currently hooks properly with the_content and the_excerpt, but when I try to hook the_post, I get the error "Catchable fatal error: Object of class WP_Post could not be converted to ...
0
votes
1answer
50 views

Update Plugin Without Overwriting Custom Settings

My plugin uses the code below that has uid="x" in it that requires the user to edit the plugin and set "x" to their user id, such as uid="420971". Whenever I release an update to the plugin and the ...
2
votes
1answer
72 views

How Can A Plugin Hook Itself To the End of Every Excerpt?

So far, I've been able to only consistently hook the_content, appending my plugin at the end. How can I test if the displayed article is not the_content, but an excerpt, and hook my plugin after every ...
0
votes
1answer
92 views

Strip HTML tags on custom code from the_content

I"m making a custom RSS feed and need a way to strip HTML tags from a custom code that grabs the first paragraph from a post. This is what I'm using: <?php $paragraphAfter = ...
-2
votes
1answer
44 views

Adding schema to text content in the loop, how?

Given the following code: <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'full', array( 'class'=>'post_thumbnail_common', 'alt' => get_the_title() , ...
0
votes
1answer
91 views

str_replace function in theme

I am trying to change the color to red on certain words on my site. However the below code changes each word to "array". Can someone tell me what is wrong with my code? function ...
0
votes
0answers
99 views

How to show single post from custom post type with shortcode

I know the topic have been around before, and have read extensively on the subject, without finding a complete solution. My goal is to have a shortcode that calls a single post, from my custom post ...
0
votes
2answers
127 views

Showing content from one page on another

There are many posts that seem to strike around this area, but I'm more and more confused by each one I read. I have a page that shows the "Terms of Service" (id = 1086). I would like to display the ...
0
votes
1answer
171 views

Remove links from the_content when using filters wp_trim_excerpt

I'm using wp_trim_excerpt which is working perfectly but I want to strip the links contained in the the_excerpt (using get_the_content), I've looked online and tried many solutions to get the thing to ...
0
votes
0answers
43 views

When can a template skip the loop?

I've reached another point with WordPress where something simple is stumping me. In working with an older theme, I have some page templates that do not call the loop. They simply use ...
0
votes
0answers
56 views

Filter the_content() to add custom figure tags

I'm trying to implment responsive images on my site, and have all the required component parts working, and understand the concepts, but need some help putting them together; Knowing that WordPress ...
0
votes
2answers
71 views

Stripping <p> tag from elements in post

I'm fine with P tags for most of the content, since it makes styling easier. However I'd like to have span div iframe and possibly other HTML tags to not be placed inside of a p for post. I saw this ...
1
vote
1answer
368 views

Only display videos and images in the_content() within loop

The issue I am trying to solve is within the WordPress loop, I only want video embeds or images to display, not any text. Currently, when creating a new post (Standard format) in the WordPress ...
0
votes
0answers
55 views

Loading ajax does not run through filter the_content

I have created a quiz page with a list of question. I use ajax to load the question content into the quiz. However, only the first question which loaded directly (not through ajax) render correctly. ...
1
vote
1answer
45 views

Changing Image Size In The Content tag

I am developing a WordPress theme locally and I can't figure out how to get an image to display in a normal size in the_content(). At the moment, the images are displaying the same size as my featured ...
0
votes
2answers
47 views

Echo Most Recent Sticky Post in Loop?

I am looking to echo the most recent post in the loop of content. Only 1 post. Do I need to put some sort of parameter on the following code: if (have_posts()) : while (have_posts()) : ...