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

learn more… | top users | synonyms

-1
votes
0answers
24 views

How to get posts without content from server

<section class="no-padding" id="portfolio"> <div class="container-fluid"> <div class="row no-gutter"> <?php $recentPosts = new WP_Query(); ...
0
votes
1answer
20 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
0answers
50 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
19 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
20 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
18 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
100 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
29 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
53 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
52 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
15 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
53 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
19 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
156 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
88 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
38 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
59 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
40 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
30 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
47 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
42 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
70 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
57 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
38 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
52 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
84 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
92 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
103 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
37 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
50 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
53 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
236 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
42 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
39 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
35 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()) : ...
1
vote
1answer
80 views

custom post type grid with content in lightbox

I'm going around every single wordpress plugin and impossible to find something with this featured . . . . I need a grid list of some custom post type - with inline filter. This is fine and tons of ...
0
votes
2answers
75 views

Problem in exploding the_content to array

I've written a code in a WP_Query to converting a string (the_content) to an array (choices). But it seems wrong! In fact, the choices array is empty after each loop. However str string is notnull. ...
0
votes
1answer
33 views

changing size image within the content

I'm trying to get my images inside the post may larger than 800px ; For this I took a function that resizes image here and I'm trying to create a function to my thumb inside the post come with size ...
0
votes
1answer
27 views

Filter Content on all Post Types

I had this idea to introduce a 'post type footer' using Advanced Custom Fields so that my users could set up common, reusable messages or calls to action and have them appear after the content of a ...
0
votes
1answer
88 views

How can I extract the URL of a link from a post?

I am pretty new in WordPress and I have the following doubt. I have a page that take some informations from a list of post that belong to a specific category and show these informations into ...
0
votes
1answer
43 views

Put teaser content, more-link and full content in different divs if existing… Possible?

im working on a flip-card template and have a problem. <div class="card" id="card-<?php the_ID(); ?>"> <div class="front"> <div class="card-headline"><?php ...
0
votes
2answers
39 views

Expandable WordPress content (text) inside a post

I've created a CPT in my WordPress site. In this CPT I have the content element (which is the default WP content) and want to make it expandable, I mean, while viewing the CPT I want it to only ...
0
votes
1answer
713 views

Dynamic bootstrap tabs with post_title doesn't display the_content

Im trying to use bootstrap tabs to have a tab system following: Each tab has the_title (post title), on click of each tab, display the content. So far, I have all the tab listed correctly, and the ...
0
votes
1answer
37 views

Information on plugin adding text when a post, page, or other such is displayed

I need to know what API a plugin would need to use to add text or HTML to the beginning or end of a posts's text when the post is displayed. I have searched on Google - but none of the leads I find ...
0
votes
0answers
21 views

the_content interrupts sidebar

I am using a shortcode in a sidebar which is getting the excerpt, and a plugin which is using the_content filter to edit the content. The problem is that what ever changes I make through the_content ...
0
votes
1answer
40 views

WordPress the_content Page Load

I am creating a Quiz for WordPress in which it replaced the WordPress post content with a Quiz if you have enabled it. There are a total of 5 questions per post and to proceed further you need to ...
1
vote
1answer
90 views

How to add custom content (text/image) at start of content (IN content ie the same line)

I would like to add some text or image at the start of each post (in a given post layout). I have found numerous ways to implement this before the content starts ie atop the content (of course, I ...
0
votes
0answers
30 views

creating one page theme but templates are not being applied to page content on the “one”page.

I am creating a one page theme. I have a loop that puts the content from each page on a single page but it does not apply the temple for each individual page. Here is the loop I am using. <?php ...
2
votes
2answers
61 views

What effect does the_content filter have on performance?

This is general question but lets say I have a function and on a specific page I want to display a table. The function only applies to one page on my site but every post/page will run this function ...
3
votes
1answer
180 views

How can I display image metadata?

I'm trying to add a filter to the_content that will find all images in the post and append the custom attachment metadata credit to it. Here's the functions I've have: Adds the Credit field to ...