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

learn more… | top users | synonyms

1
vote
1answer
28 views

How to have a “clean” post content, for excerpt and social networks sharing

Sometimes I start my blog posts by : This is a guest post.... This is a sponsored post.... [download]This is a download for the post[download] [youtube]this is a video that I put in the begenning[...
0
votes
1answer
553 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
2answers
137 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
2answers
474 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
465 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 ...
0
votes
1answer
56 views

Shortcode to eliminate <p> and replace </p> with <br>

I have a filter that removes opening p tags and replaces closing p tags with a br tag sitewide. The client would like this filter in a shortcode that they can use only on specific portions of the site....
0
votes
0answers
68 views

Filter the_content() to add custom figure tags

I'm trying to implement 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
1answer
23 views

How is WordPress changing the content markup?

In my post there is Visual and Text tabs. I've formatted some content and in the text tab it looks like this: <strong>The Mission Statement –</strong> The following is a mission ...
0
votes
1answer
32 views

Cannot retieve the_content() and the_author() - both returning empty strings

I am creating the following code to display open graph meta data in the header of my single.php page add_action('wp_head', 'mycode_add_og_meta_tags', 5); function mycode_add_og_meta_tags () { ?> ...
0
votes
1answer
77 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 ...
6
votes
2answers
211 views

Insert Custom HTML After Shortcode

The scenario is that I need to add an HTML banner under a slideshow which is a shortcode in the homepage content. I personally hate adding a bunch of div tags to the TinyMCE editor so I'm trying to ...
1
vote
5answers
401 views

How to use wp_rel_nofollow to add nofollow to external links only?

I want to add nofollow attribute to only external links in the content of the post. Internal links should stay follow. So, can I use wp_rel_nofollow() to make only external links nofollow? Or do I ...
1
vote
2answers
915 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 (is_single())...
0
votes
4answers
2k 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
0answers
22 views

wp query doesn't return html tags

In file I have the following (only part is showed below): <?php $args = array( 'name' => 'contact-us', 'post_type' => 'page' ); $q = new WP_Query($args); ...
1
vote
1answer
56 views

'the_content' filter removing html tags from post content

I have a post content(html) like this: <div id="home_tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin ...
0
votes
1answer
21 views

How to add content with a filter when there's no content in the editor

I'm building a plugin to create page sections (with ACF and repeater field) and I want to add the sections at the end of the content. The sections are added to the content, but only when there's ...
4
votes
1answer
43 views

Add post/page ID to inserted links within the_content

Within the main content editor of posts and pages, we can insert multiple links to other posts/pages: <a href="http://example.com/hello-world/">Hello World</a> What I am trying to do is ...
0
votes
1answer
29 views

Change Content for Specific Page

I want to be able to replace a page's content if it is a very specific page. Here is what I've written so far: function signup () { global $post; $slug = $post->post_name; if (...
0
votes
1answer
32 views

Hook added to the_content seems to be called multiple times

I have the following code running in a plugin: add_filter('the_content','thousand_pay'); //Callback function function thousand_pay($content) { echo $content; if( !in_category( 'Stories') ) ...
3
votes
2answers
41 views

Where to hook into post content?

Which hook or filter is used to edit the post content before the_content filter is applied to it. For instance, if I wanted to add Hello World, as the first text in every post.
0
votes
0answers
11 views

Disable wp_link_pages() function from theme through plugin [duplicate]

Spent couple of hours trying to fix the problem but I couldn't. Hope you guys will give me some insights. I'm writing a plugin to include the wp_link_pages() functionality. I'm adding it with the ...
0
votes
1answer
18 views

Cannot Find Hook that is changing the_content()

I am working with a wordpress theme that is using Foundationpress as it's starter theme. When I use the_content() all img tags have there css class replaced with image. This is overwriting the ability ...
1
vote
1answer
513 views

How to ignore or disable nextpage tag?

I have this site that uses the <!--nextpage--> tag in posts for pagination purposes. I want to disable pagination, but without deleting the tags for the database (maybe they'll want to use them ...
1
vote
3answers
140 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. ...
3
votes
1answer
55 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( 'the_content',...
0
votes
3answers
36 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
0answers
29 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 ...
3
votes
1answer
2k views

Add something to beginning of the content

I'm using add_action('the_content', 'myFunction', 10) to append data to the end of the content. How can I place content at the beginning of the content?
0
votes
2answers
78 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 ...
2
votes
3answers
5k 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
32 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
3answers
316 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
0answers
27 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 ...
-2
votes
2answers
44 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?
-3
votes
1answer
36 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
185 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
40 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 (is_page($options['...
2
votes
2answers
5k 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. ...
5
votes
1answer
126 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
24 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
88 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 ...
1
vote
0answers
37 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
98 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 ...
12
votes
2answers
7k 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
1answer
44 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
104 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
33 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
129 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 ...