Questions tagged [the-content]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

How To Watermark Audio

Does anyone know a way or plugin that will help me to automatically watermark any audio uploaded in the wordpress media library
1
vote
1answer
20 views

Styling text and images in the_content()

So I have recently started working on Wordpress and coming from a different programming background, having the logic but not being able to actually code is an issue I have been butting my head on for ...
1
vote
1answer
22 views

Uppercase first sentence in every post

Brand new to this community but been tinkering with WordPress for years. I would like to edit my website's functions.php file to be able to automatically do a task I have to do manually each day. ...
0
votes
1answer
18 views

How to show Social share buttons outside the post?

i am getting social share button inside of every post but i need ouside of every post For reference please find the attached image. i need like this
0
votes
0answers
10 views

WordPress v5.4.2 escapes the content of Edit Attachment > Description field

I updated WordPress to v5.4.2 and now the content on the screen Edit Attachment, field Description is being HTML escaped so I cannot use HTML in this field. The problem seems to be caused by this line ...
0
votes
2answers
24 views

Assign custom class to post content images

Is possible to assign a default class to the images that are part of a post content? I have a problem with teh layout, this because the attached images insetred inside a post will break my bootstrap ...
0
votes
2answers
34 views

has_excerpt() not working inside wp_query

I am trying to check for an excerpt and if it doesn't exist then show the content but trimmed. Currently nothing is showing. <?php if (has_excerpt() ): ?> <p><?php echo ...
0
votes
1answer
11 views

Add a div of content within the_content after a certain block

In gutenberg I have several blocks: paragraph heading paragraph code paragraph In php I'd like to find the code block and append content after the block. I'd imagine I need to use add_filter and ...
0
votes
0answers
14 views

Best way to add ACF fields to post_content

I have a post type and the content of every post is entirely from custom fields. Image fields, various text/wysiwyg fields, and others. There are certain plugins I want to take advantage of that rely ...
0
votes
0answers
12 views

One post per one column item in a row. How to?

I am planing to construct a new responsive website from sratch. Initial plan is at least one row with three columns for index.php (within body tag). What approach would be better to achieve my goal so ...
0
votes
0answers
50 views

How do I output ACF custom fields within the_content() AND strip tags?

I'm trying to output a text-only version of the_content, that includes all custom blocks. echo wp_strip_all_tags( get_the_content() ); strips tags and outputs text only, but only for native content. ...
-1
votes
1answer
24 views

How to add custom HTML markup and classes to the_content()?

I have HTML template for output from the_content() function. It contains elements with custom classes such as <blockquote>, headings or paragraphs. <p class="mb-40">Nemo enim ipsam ...
0
votes
1answer
21 views

the_content() not showing the content in good order (with a shortcode)

I've added a shortcode [form] inside my wysiwyg the 2 paragraphes before the shortcode. <p>test 1</p> <p>test2</p> [form] but on the frontend, the shortcode is showing at ...
0
votes
0answers
9 views

How do I isolate and customise the content of Wordpress blog posts (such as images and texts blocks)?

I am currently developing my own theme in Wordpress for my blog and aim to customize as much as possible, only really using Wordpress for its CMS. I have drafted out the basics of a Wordpress theme ...
1
vote
0answers
33 views

Force Balance Tags not working

I am trying to shorten my the_content() word count to 200 while retaining the html formatting as well as the shortcodes. I am pretty close but for some reason, I cannot get force balance tags or ...
0
votes
0answers
16 views

Hook for after content field, not the_content

Is there a hook to insert code after the standard content field? Not 'the_content' hook, which encompasses the entire content, including all the custom fields. Just the content field text, I would ...
0
votes
0answers
22 views

how can i take wordpress post as embed?

how can i get an adress for using iframe in another website? Example: site.com/sample-page i will use this page in another website as iframe but only content part Example: <iframe src="site....
0
votes
1answer
29 views

does wp function the_content(); accept another tag inside

I want to place some other PHP tag inside the_content() is it possible somehow? <?php the_content( $custom_attach = get_post_meta( $post->ID, 'wp_custom_attachment', true ); $...
0
votes
1answer
58 views

the_content() not displaying the full post

When I use the_content() in the template php file, it displays the_excerpt() instead of the full post content. I tried removing all filters with remove_all_filters('the_content'); But it still ...
1
vote
0answers
24 views

How can I add class to every quote element?

How can I edit defualt class of quote element? Can I use some kind of hook in the_content to add class to any other element??
-1
votes
2answers
47 views

Where can I find the “add_action()” inside a theme?

I'm developing a WordPress plugin for a site that is using the theme ColorMag. The plugin uses the_content() to insert some content in a page. When I put the plugin in other test site, the content is ...
0
votes
1answer
67 views

Get featured image from post on RSS feed

I want to add the featured image to my RSS feed. function rss_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = '<p>' . ...
0
votes
1answer
35 views

How can I show the actual content of Posts page because the_content() is showing all blog content?

In Settings>Reading I have the following static page set Homepage: Welcome to blurr (front-page.php) Posts page: Blog Posts (home.php) I'm trying to get the_content of the Blog Posts to show ...
1
vote
0answers
119 views

Removing “wpautop” (auto <p> tags) only on certain pages?

I'm using the remove_filter in functions.php to remove the auto insertion of <p> and <br> tags on my wordpress site. remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt'...
0
votes
0answers
274 views

Auto generate excerpt from ACF field on a CPT that does not support excerpt or content

I have a CPT which contains only 4 wysiwyg fields created with ACF. The CPT does not support standard WP excerpt or content fields. I would like the CPT to generate an excerpt automatically from one ...
0
votes
0answers
53 views

Remove pre and code tags from WordPress

WordPress has added both <pre> and <code> tags to my PHP embedded in a post. Here's an example <pre><code>register_taxonomy( 'Books', 'post', array( 'label' =&gt; __(...
0
votes
1answer
56 views

Highly stylized pages

I'm building my own WP site, with its theme from scratch, and I need 2 very customized pages, including the front page. To give you an idea, a bit like this. (mine will be more simple though) That ...
0
votes
1answer
81 views

Omit image captions from get_the_content()

I use a theme that calls get_the_content() to display short excerpts of the latest blog posts on the home page. Now I noticed that the excerpt sometimes starts with an image caption, if the blog post ...
0
votes
1answer
494 views

How to get different html tags from the content using regex?

I am trying to get different html tags from a single post and display them as nested accordion. I have quite accomplished. the only problem I have is that. When I try to show all the p tags content ...
0
votes
0answers
45 views

How to make the_content() function to display only the text inside a specific paragraph targeting its class? [duplicate]

this is the content of a single post: Dec 4, 2015, First paragraph Feb 3, 2016, Second paragraph Feb 3, 2017, Third paragraph I am currently using a plugin named PHP Code which allows to ...
0
votes
0answers
12 views

Post content is escaped when visual editor is turned off

When visual editor is turned off, then $post->post_content is escaped. With visual editor turned on, the exact post content is obtained as saved. When visual editor is ON, output of $post->...
0
votes
1answer
73 views

What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?

I'm working on a plugin that takes $content for a post and alters some of the HTML. Seems there are two common ways to accomplish this in WordPress - using jQuery or using PHP's DOMDocument. I'm ...
1
vote
1answer
391 views

Error shown for Trying to get property 'roles' of non-object in Wordpress After Content for User Roles

I have been struggling to code a function, which echoes a code, when the user role is 'administrator' or is um_verified' Honestly I don't know much of what it means, but still, I want to solve this ...
0
votes
1answer
38 views

Add shortcode inside of the_content()

I have a custom post type (events) and i made a custom template for archive and for single. On single i want to add a shortcode to every post, this shortcode provides all dynamic data of the current ...
0
votes
1answer
199 views

Undefined variable error in new function

I wanted make function to count the time last the user read the article but after putting it in fuctions.php I see this error: Notice: Undefined variable: post in /home/karnetac/public_html/wp-...
0
votes
0answers
10 views

My edits are not saved

Everything used to be fine, but now for some reason I’m editing the record, but the old content remains, the new one for some reason does not appear. For example, I have everything stored in the pages ...
0
votes
1answer
43 views

How to bind each “the_content” elements to a custom variables

I'm implementing bootstrap theme into wordpress and i need you'r help. In Wordpress i created a simple page with paragraph and a list of 3 item's. Product list one Product one - Link Product two - ...
0
votes
1answer
39 views

How to use embed_content hook?

From the document of embed_content: Prints additional content after the embed excerpt. But I don't know which content it will print. Does it take any arguments?
0
votes
1answer
16 views

auto link word link in content

i use this code for auto link word in content <?php function link_words($content){ $words=array( 'test1', 'test2', 'test3' ); $links=array( '<a href="/tag/test1/" rel="nofollow"&...
0
votes
1answer
38 views

How to hook code to show after the_content?

I am trying to hook some content AFTER the_content, but no matter how I do it I still get my custom content BEFORE the_content: add_filter( 'the_content', 'ow_add_sctns_to_ctnt' ); function ...
0
votes
1answer
213 views

the_content() printing DOCTYPE, <html> and <body> tags in the middle of page

I'm building a custom Wordpress theme and I've just come across a bizarre issue where the_content() seems to be printing out the page content wrapped in the following: <!DOCTYPE html PUBLIC "-//...
0
votes
1answer
19 views

How to remove a specific word at the beginning of the content and add it to the end of the content

I want to remove any words in the text of posts, before a specific letter (such as :) that comes at the beginning of the text and add that word to the end of the text. for example: » Original text ...
0
votes
1answer
36 views

Shortcode conflicts

My plugin provide shortcodes like this: [cfgeo return="city"] - returns city name [cfgeo include="us"]Text only seen in the US country[/cfgeo] - returns this text only from the visitors in the US. ...
0
votes
0answers
34 views

How to wrap pattern-matches from the_content in [wiki]-shortcode tags

I'm working on a function to wrap word-matches* in [wiki]-shortcode tags. I suspect the best method is to use add_filter() on the_content, and parse using RegEx in preg_replace_callback_array(), but ...
0
votes
2answers
894 views

Filter Gutenberg Blocks Content

I have a simple terms page made up of heading and paragraph blocks. I'd like to filter the_content before output in order to get the content of any heading blocks and create a menu with links to named ...
0
votes
0answers
41 views

Cannot replace header & footer using “the_content”

It replace everything except header & footer. I've tried different priority for this function but it doesn't seem to work. I think the_content is only for content and not header/footer, but after ...
0
votes
1answer
124 views

Replace an array (with identical values) with another array in the_content

I'm making a plugin where I need to edit the H2 tags in the post content. I've been at it for two days, but my php knowledge is too limited to solve the issue.. What I want to achieve is to return ...
0
votes
0answers
28 views

Wordpress the_content Filter and GET Parameter

i have the following Problem and i have no ideas left. I try to explain: We have some Producttests you need to register for. A Post can be a Producttest, wich is indicated by a checkbox in the ...
0
votes
1answer
118 views

Strip all HTML tags from product content and resave

My client has loaded about 500 products into Woocommerce, but has inadvertently pasted in a stack of extra tags into the product description- divs and spans etc like below: <div class="summary ...
1
vote
2answers
324 views

Wrap h1-h6 in a div

So, I am using heading tags h1-h6 on my site in various places, what I'd like to do is put a div around those tags using a WP function. Right now I am using some jQuery to get the job done, but I'm ...

1
2 3 4 5
11