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

learn more… | top users | synonyms

1
vote
1answer
44 views

Execute Closing Shortcode After the_content

I need to execute a short code on thousands of posts which don't already contain the short code as i've added some manually. I'm using another function to add the opening short code after the 2nd ...
3
votes
1answer
87 views

the_content and wp_link_pages

Many plugins seem to be adding a filter/action hook to the_content to display related posts, advertisements and such. The problem is I these appear before the post pagination so it the pagination is ...
-5
votes
1answer
36 views

How can I customize the_content(); output? [closed]

I want to customize every image or p of the_content(); output, assign class and so on.. What I have to do?
0
votes
0answers
29 views

the_content() - Getting formatted text

I'm using the_content() to display the content of a post in my theme, but unfortunately im getting plain text (with link and pics of course but the other are just plain text). I want to get formatted ...
0
votes
0answers
14 views

split the content using more tag and array

I'm trying to create a function that allows me to SPLIT the_content in wordpress using the more tag in the posts field. However, I don't know what I'm doing and seem to be making a mess In my ...
0
votes
1answer
20 views

ECHO Executing 4 Times In Head

I have a plugin I created as a test and am running into a bit of trouble. The code is executing 4 times and placing what I echo in the <head> tag of the page. The reason I'm performing an echo ...
2
votes
2answers
39 views

Is it possible to handle a specific section of a post separately?

I've tinkered with WordPress a little, but I'm far from an expert, so apologies in advance if this is a duplicate question. I've built a simple WordPress theme based around Bootstrap, and I can ...
1
vote
1answer
18 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 ...
0
votes
1answer
25 views

get query() without post content?

Is there a way to get query with post information (thumbnails, id, etc.) but without the_content()? I already have plugin to show recent posts in sidebars at homepage and when it is for example 20 ...
0
votes
1answer
18 views

Insert div after h2 in content

I'm trying to insert a div with a small bit of content immediately after the /h2 of single posts. I've given single posts a new class to help trigger this, as I don't want it after the /h2 on a page. ...
0
votes
4answers
900 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
2answers
370 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
0answers
12 views

How to parse a post and change the way a gallery item is rendered?

I want to use this plugin http://final-tiles-gallery.com/index.html to display the gallery the users insert in their posts, for that I need to use an specific HTML structure so the plugin works, I've ...
0
votes
1answer
19 views

Function the_content

For some reason on my attachment page template (http://capa.furniture/?attachment_id=1494) I am getting the url of the reduced size image. I do not know why. I am not getting the thumbnail full size ...
0
votes
0answers
20 views

Custom image size in the_content loop

I changed the default image dimensions for the "large" thumbnail and re-generated my images using a plugin. The new image size is only shown on new posts created after the image size was created. How ...
0
votes
1answer
31 views

Replace image scr with it's surrounding href

I'm trying to add a filter to the content to replace the src of all images in the content with it's surrounding href link. Any ideas how to go about this? The only thread I could find that came close ...
-4
votes
1answer
1k views

How I can show short content with short tag

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

Word limit in post_content after more tag

I am using the following code to hide the teaser and show content only after more tag in loop: <?php $after_more = explode( '<!--more-->', $post->post_content ); if( ...
0
votes
1answer
25 views

Should I find/replace values in the_content?

I'm creating a plugin specialized for a website. Most of the pages are pretty general (blog posts, contact pages, etc...) but a handful of pages will have custom code (specific SQL) for display ...
1
vote
2answers
456 views

Replace audio links with jplayer using the_content filter

I am attempting to use : add_filter( 'the_content', 'filter_function_name' ); To find all of the anchor tags in my post which link to a .mp3 file, and then replace them with a jplayer instance that ...
0
votes
0answers
26 views

get_post_fields as an excerpt

I have a strange question, I have built my site and my loop etc. But on my sidebar I want to add a sort of random post display, but I don't want the entire post to display, I've had some difficulties ...
0
votes
2answers
43 views

the_content() returning unexpected div wrappers

When I call the_content() i am getting <div class="page" title="Page 1"> <div class="section"> <div class="layoutArea"> <div class="column"> ...
0
votes
1answer
21 views

find shortcode inside content of post

I've a post with a video, contained inside the content. So, the content of my post is like: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam quam sed imperdiet viverra. In ...
0
votes
1answer
55 views

Can't get the_content to show

I'm using the following code to get posts from a category in a page. This category uses ACF for some fields. However, when I try to output everything, it shows everything but the_content. For better ...
0
votes
1answer
25 views

Concatenate a Function to the Post Content

I am trying to use the following to concatenate a function's output to the post content: function bottom_content($content) { global $post; $content .= course_resources($post->ID); ...
0
votes
1answer
15 views

Add Image Before Posts Entry Title

This code adds the image before all titles on the page. How do i add one single image before the posts entry title? function adt_abovetitle($title){ //Return new title if called inside loop ...
0
votes
1answer
66 views

page.php not displaying content

I am using a page.php template I have used on about 400 Wordpress websites, and all of a sudden the loop decides it doesn't want to display any content. Code is: <div class="text-content"> ...
0
votes
2answers
24 views

How can I output the content of the page using this code?

I found this code on stackoverflow, but how do I output the actual content rather than just that ID line in the example! <?php $the_slug = 'my-page'; $args=array( 'name' ...
0
votes
1answer
22 views

Showing content from Wordpress ruins page CSS using WP_Query, without, content does not show

I suppose I have a two pronged issue here. I'm trying to show wordpress posts on my own site. I have a page where people can view the list of articles, then when they click on one it takes them to the ...
1
vote
1answer
258 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: ...
1
vote
0answers
39 views

More efficient to add content to custom fields or the content area?

I often build themes that handle a lot of text content. I use Advanced Custom Fields to create several custom field areas per page for adding this content. I've also used themes with page builders ...
1
vote
1answer
356 views

apply_filters('the_content', $content) vs do_shortcode($content)

Lets say I have a theme option or custom postmeta text area. Now I want to execute multiple shortcodes, general texts, images etc. What will be best practice and why? Option 1: $content = //my text ...
0
votes
2answers
3k 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. ...
4
votes
2answers
4k views

why doesn't the_content() work in this {single-custom_post_type.php} page?

This code is from my page single-publication.php. It outputs the relevant custom fields etc (here wrapped in template tags), but the_content() won't output the post content. I've resorted to using ...
0
votes
2answers
564 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
0answers
45 views

<p> tag removed not using a filter

Very strange WordPress behavior: <p> tags are removed when placed inside <pre> tags, but not always. for example, this works fine: <pre><p>This is a ...
0
votes
1answer
30 views

Empty the_content for all posts

I'm moving everything that is displayed with the_content in custom fields and i want to remove/emtpy the content of the post_content column in the database, for every post. Is there a mysql query ...
-3
votes
1answer
50 views

Which action/filter can i use for a Member Plugin [closed]

I'm a beginner in Wordpress Plugin development. I want to write a Plugin for a Member Part on my Page. I know, that Plugins for this Problem available, but i want to create an own Plugin ;) I want to ...
0
votes
2answers
279 views

Add shortcode within the_content()

I'm trying to add a shortcode within the text of the_content(). It is possible to add it to the beginning or the end however I cannot figure out how I would get it to show after say 200 characters. ...
0
votes
1answer
44 views

The_content is different from category archive to other pages [closed]

I'm trying to use a plug-in that is adding bookmark button to the posts. It's working well except in the category archive page: I can't figure out why the_content() on page, post and archives (tags, ...
0
votes
1answer
80 views

Visual Composer integration

I've installed Visual Composer on my own template. The thing is that is not rendering all it's shortcodes. <?php $post = get_post( $post->ID ); echo $post->post_content; ?> Is that ...
0
votes
0answers
73 views

How to get one specific div from the_content()?

i'm trying to substring the_content() to get a div with a specific class. i'm using wpbookmark plugin, that add, at the beginning of the content, one div with the button to bookmark the post and i ...
0
votes
1answer
22 views

Remove images from the_content [duplicate]

I'm trying to show only content with all paragraphs (possibly divs,...) but with no attached images. I had some success with: echo preg_replace('/<img[^>]+\>/i', '',get_the_content()); ...
1
vote
3answers
121 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 ...
0
votes
1answer
53 views

filter h1 tag to add a word at the beginning of the text

I'm looking for the best way to obtain this. For example, I have the h1 tag whic is: Web Design I want to add, in all the h1 tags of a certain post type, the same word at the beginning, which is my ...
1
vote
3answers
48 views

the_content() seems to block my ACF-code

I have this simple code, but can't get the_content and the ACF-code to work together. If I include the_content() it blocks out the ACF-code, but if I remove the_content() the ACF-code works fine. I ...
0
votes
2answers
81 views

How to add pagination in between post and comments?

I am trying to add pagination in between post and comments. I used plugin Automatically Paginate Posts for that in which i can able to add pagination after comments and facebook plugin. Is it ...
1
vote
1answer
784 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" ...
0
votes
0answers
32 views

Capture the content of a second page to an output buffer

I have plugin with the following admin action which allows me to send the contents of a specific wordpress page to a registered user via email. The code was working perfectly, an email was sent and ...
0
votes
0answers
18 views

How can I append content from another given id in the current post?

I need to append the content from a couple given post ids, into another specific pages. This is what I've tried but it's not working. The goal is to append the content from posts id 1794 and 2094 ...