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

learn more… | top users | synonyms

-1
votes
0answers
35 views

Hide a div to Fade_in another one ( the_content) for custom post type

--EDIT OF FULL POST--- OK - I manage to hide the div on click - then fade in the_content of the post. However - the_content is outside my loop - so it doesnt display the_content of the related post ...
2
votes
2answers
45 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
24 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 ...
0
votes
0answers
17 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
31 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
17 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
33 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
20 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
13 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
33 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
21 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
18 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
0answers
32 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
146 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
1answer
27 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 ...
1
vote
0answers
37 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 ...
-3
votes
1answer
42 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
1answer
33 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
47 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
47 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
21 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
88 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
43 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 ...
0
votes
2answers
58 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 ...
0
votes
0answers
29 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 ...
1
vote
3answers
40 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
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 ...
0
votes
2answers
98 views

Proper way to replace the_content only for pages created by custom plugin

I'm creating a plugin that needs to replace the_content of only two specific pages that it created upon activation. Here is my code: add_filter('the_content', 'emd_content'); function ...
0
votes
1answer
66 views

the_content() behavior on attachment.php versus single.php

I'm having some trouble getting the_content() to work on attachment.php. I have a template page that has the basic loop and simple calls the_content() in the loop to display the post. Scenario 1 ...
4
votes
3answers
345 views

the_content and is_main_query

I am filtering the content with the the_content filter. Everything works perfect, excerpt that my changes are applied to custom queries as well. My changes appear in the sidebar as well if the widget ...
0
votes
0answers
48 views

Splitting content into two columns and shortcode-slideshow above

I am working on a custom template that will allow me to display a shortcode gallery in full width, and below that, the text from the content of the post in two different columns. I have been able to ...
0
votes
1answer
44 views

What is the earliest hook to modify post content?

I have installed a plugin that adds stuff at the end of the content. I just want to apply my modifications to the post content before this plugin does. In my case or otherwise, what is the earliest ...
0
votes
1answer
22 views

the_content inside my own theme does not retain line breaks / enters like in the admin

Ok, I tried everything. the_content, get_the_content, filters, disabling plugins, Chtulu. Nothing. In my own theme, the content retains the format given in the admin editor (like bold, italic, ...
-1
votes
2answers
37 views

Single loop with dual content area

Is there a way to implement a single loop with dual content area. E.g. A single loop having 2 of <?php the_content(); ?> Dinstinguished as shown bellow with video and write-up respectively ...
0
votes
0answers
8 views

How to send default value with new parameter on 'add_filter' [duplicate]

I'm filtering the_content and want to pass a second parameter with the filter for context. My problem is, I don't know how to pass the default value, $content as well as my new parameter, ...
0
votes
0answers
28 views

Search & Replace trailing strings

I need to filter the_content/the_excerpt and search & replace the following prepared array: $searchArray = array("foo", "bar", "foo bar", ...); My problem is the fact, that using php's ...
0
votes
3answers
30 views

the_content() not working in my Android mobile

I have got a little problem. I am working in a theme developed by someone I don´t know. I was testing the site in my cellphone and saw the_content() function does not show anything. I checked in one ...
-1
votes
1answer
35 views

Auto populate a Form

I'd like to auto populate a form / Text area with the post content ! For Example : The link below has got a link which take it to the form ! http://cozysms.com/passenger-tumne-mere-jeb-me-hath/ ...
-1
votes
1answer
108 views

After adding filter to plugin's code, post's content doesn't display

After adding a filter to plugin's code, the post-template.php is not showing the post's content. This code in plugin's index file: add_filter('the_content','post_add_me'); function post_add_me(){ ...
0
votes
1answer
31 views

Making a specific page wordpress compatable that is not index

When I first created my website I overwrote the wordpress php and essentially made the website static. Now I want to make one specific page wordpress compatable (e.g. when i make posts from the ...
0
votes
0answers
85 views

Some shortcodes breaking after AJAX call

I have a content slider that displays my Academic posts on my website. Some of my posts have shortcode in order to display an accordion menu and some columns. I am using AJAX to fetch the posts and ...
1
vote
1answer
30 views

How to modify how the_content outputs a link to an internal page

I like the default add link dialog in the wordpress editor. IT allows for easy linking to internal pages. I need to modify the output of those internal links. Right now its outputting: <a ...
0
votes
2answers
47 views

Retrive images from the_content()

I would like to get the images from the_content(), I know I could use a regex to get the images but I wanted to know if there is any other more 'wordpress way' for doing this? I have this within a ...
0
votes
1answer
294 views

Divide post content in three columns

Is it possible to split the_content() into three equal size columns? I have tried to achive that by getting this code which I found here <?php $content = get_the_content(); ...
0
votes
2answers
56 views

the_content() brings the medium size image [closed]

So I have the problem, the image I want to dispaly in post is not big enough and in my preffered size it gets bad quality, then i noticed that is not the default size image returned it's medium size ...
1
vote
1answer
168 views

Apply the_content filter, but prevent other hooked actions

I have a plugin that displays some content onto the front end of the site after applying the_content filter to the block of text. I do this for formatting and maintaining links and images etc. When I ...
3
votes
1answer
78 views

Add Incrementing ID to each paragraph in the_content

I need to loop through each paragraph in the_content and add an ID to each paragraph with an incremental value. function incrementparagraphs( $content ) { for ($i = 0; $i <count($content); ...
0
votes
1answer
163 views

Email Obfuscation: Is antispambot() Acceptable? [closed]

I've been looking into Email Obfuscation and trying to get away from obfuscation plugins when I ran across this code snippet[1]: function remove_plaintext_email($emailAddress) { $emailRegEx = ...
0
votes
1answer
174 views

How to make post content from each post display within the same div

Basically what I am trying to do is have the featured image of each of my posts display in rows of 3 showing only the featured image. When you click on one of the featured images, a div above the row ...
1
vote
1answer
459 views

Only show content before more tag

I am using the Siren Template. In homepage.php this code is used to display the portfolio content print_excerpt(200); But I to need show the content only before <!--more--> I have used this: ...