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

learn more… | top users | synonyms

-1
votes
0answers
30 views

Move plugin content into the_content

I have a plugin to display author content in a post. The plugin is working as intended, but I'd like to move the display of the plugin above the pagination. Since the pagination tool is contained ...
-3
votes
1answer
32 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
353 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
2answers
182 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
26 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
17 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
22 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
17 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
40 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
32 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
30 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
24 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
4answers
725 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 ...
1
vote
1answer
728 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
24 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
11 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
55 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
3answers
3k views

Insert Ad Code in the Middle of a Post

I want to insert an ad code in the middle of a post via functions.php. I found several links but either they don't use functions.php or don't insert the code in the middle. Can anyone tell me how to ...
0
votes
1answer
35 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 ...
0
votes
0answers
45 views

the_content filter doesn't work on archive pages

the_content filter only seems to work on single posts, but everything I read says it should show up on archive pages too. How do I get the following function to work on an archive page? add_filter( ...
4
votes
3answers
219 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 ...
2
votes
3answers
3k views

Removing any and all inline styles from the_content()

For one of my current projects, I had to transfer blogposts from an old Wordpress site to my project. Things went smoothly until I've seen that all the posts were copy pasted from Word, leaving this ...
0
votes
0answers
28 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
42 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 ...
1
vote
3answers
916 views

embed the_content

Im trying to wrap video urls and embed code in a classed div so that I can style it. The vid code is being pulled from the custom meta value I've setup for the video post type. Nothing I've been able ...
0
votes
1answer
18 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, ...
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 ...
-1
votes
2answers
31 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 ...
3
votes
4answers
4k views

Modify 'Read more' link adding a new class

I want to add a class to the 'Read more' link. Actually I have this: <?php the_content( 'Read more...' ); ?> Which outputs: <a href="...?p=14#more-14" class="more-link">Read ...
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, ...
1
vote
1answer
887 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
3answers
28 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 ...
0
votes
0answers
27 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 ...
-1
votes
1answer
31 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
70 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
30 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
68 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
382 views

Function to wrap the_content in a div

Whenever I've developing a new theme I always wrap the_content in a div, like so; <div class="entry-content"> <?php the_content();?> </div> Is there a way I can streamline ...
1
vote
1answer
28 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 ...
1
vote
4answers
781 views

How to add an inline style to the <p> tag outputted in the_content() using PHP?

I am trying to add an inline style to my paragraph tags which are ouputted using the_content(); I've tried string replace, see question I did earlier. But it won't because the_content echo's it and ...
0
votes
2answers
44 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
178 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
49 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
127 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
71 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); ...
1
vote
2answers
440 views

get_the_excerpt() not returning anything when post has no excerpt

When trying to call get_the_excerpt() the page does not return anything on posts that have no excerpt. I thought WordPress usually 'fake' it and create one using the first x characters from ...
0
votes
1answer
102 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
146 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
288 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: ...
0
votes
2answers
76 views

the_content() Returns post content when I want page content

I'm very new to WordPress, but I'm currently doing work on a site built on the platform. I'm making my way through, but I've run into a bit of a problem. I'm trying to add content from the text ...