Questions tagged [post-content]

The tag has no usage guidance.

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

get content of author page

is there a (reliable) way to get the content of an author page ? I need to get the list of the shortcodes on the page, actually, so i wanted to use get_shortcode_tags_in_content(), but for that i need ...
hugogogo's user avatar
  • 111
1 vote
2 answers
109 views

Content Restriction but allow public REST API

My Question, is it possible to restrict the content from a post (shwo e.g. teaser/excerpt only) but still let access the content fully by the REST Api interface? My scenario is that i would like to ...
RestAPPDev's user avatar
0 votes
0 answers
22 views

Separate page for pagination possible?

This is how my index.php looks like for my custom theme (I'm not sure if Line 4-5 is necessary). When I put pagination in the home or post, I would like to be able to take the user to a separate ...
Elaine Byene's user avatar
0 votes
1 answer
1k views

Store custom post type with JSON content

I'm building a mobile app and website on a WP backend, which is the reason why I'm looking for a uniform JSON Request-Response pattern. Everything's working fine, and the wp installation does not use ...
DevelJoe's user avatar
  • 487
0 votes
1 answer
83 views

REGEXP_REPLACE in post_contet

So, basically, I want to remove trailing slashes from specific domain urls. For example: https://www.example.com/here/postname/ into https://www.example.com/here/postname I have 10.4.21-MariaDB which ...
Ivana Kruljac's user avatar
1 vote
0 answers
22 views

Which WordPress hook fires after post content loaded?

Is there any hook that fires after post contents load? before comments and ... I need to add an element at the bottom of the post content.
Mohammad Mahdi's user avatar
0 votes
1 answer
436 views

ACF flexible content block not showing on live site (works locally)

I've made a flexible content section in ACF for a specific category that allows the user to post text and different image galleries onto their post. This all works perfectly whilst I'm on my ...
Laura's user avatar
  • 1
0 votes
1 answer
23 views

image resizing on post content without css and html tags

Background: I am using WordPress posts for Newsletter. I am importing the posts through an api and use them in a Newsletter tool to send them out. I am downsizing the featured image before feeding to ...
Janith Chinthana's user avatar
0 votes
1 answer
381 views

How to display tags with post_content

I have this code to display the content of a specific post outside the loop (actually in the archive.php template file). How do I include the tags? <?php $my_id = 1576; $post_id_1576= get_post($...
Pete's user avatar
  • 998
0 votes
1 answer
196 views

Is there any way to get list of all possible filter hooks for all post types?

I would like to code a plugin that injects the custom content to any type of post (post, page, product, any others) but I would like to allow the users to let them select the place of content too. ...
Alper's user avatar
  • 183
0 votes
0 answers
549 views

Is there a way to get rendered html content of a WP post after updating?

I tried adding a filter at the content etc but that one just gives access to content stored in wp_posts. I am interested in getting the rendered html with meta tags etc for a post, after it is updated....
chatnoir's user avatar
0 votes
0 answers
256 views

Add data attribute of post_id for Internal links

I noticed that internal links to other posts have data- * Attribute. One of Post ID. And the other of Post Type. (As in screenshot). The problem is, it's only in the block editor (Gutenberg). And not ...
Adiel's user avatar
  • 1
0 votes
0 answers
167 views

How delete post_content records of specific category from phpmyadmin

I need a SQL command to delete post_content records for specific category's posts
akhbarejadid's user avatar
1 vote
1 answer
361 views

Copy content stored in meta to post content

I'm working on a site that had an existing theme that used meta fields to store blocks (bad practice IMO but pre-block editor). The problem is there are over 300 posts and all the different "...
themattyg's user avatar
0 votes
1 answer
29 views

How to get unmodified post content?

How do you get the unmodified post content? It seems WordPress modifies the post content. It changes the HTML by adding or removing from it. This post is different from this post: Get WordPress post ...
1.21 gigawatts's user avatar
0 votes
2 answers
1k views

How to wrap all titles generated by Gutenberg "Heading" block with <span> tag

Gutenberg is still relative new concept, so I lack experiences (and the Internet lacks good tutorials). My goal it to wrap all heading titles generated by Gutenberg's "Heading" block with the <span&...
Jasom Dotnet's user avatar
1 vote
0 answers
63 views

How to filter post content and force every link (<a>) made in blocks to return urldecode(<a>) with readable value?

Will really appreciate your help with something. I'm using non English letters in my URL slugs. So every time I add an internal or external link with non English letters to my post (via blocks editor ...
Victor's user avatar
  • 25
0 votes
1 answer
60 views

replace control character ascii into page

I observe that a copy-paste containing the control character '^L' (ie FF) causes an error with 'vimrepress'. Wordpress publishes the page but vimpress cannot load it. I would like to replace this '^L'...
Dhénin Jean-Jacques's user avatar
0 votes
0 answers
29 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....
Murat Aksaç's user avatar
0 votes
1 answer
54 views

What is $post->pre_post_content exactly?

We have an issue with getting updated data for editing from one of our posts in our site and i found this piece of code to get the content of the post $post->pre_post_content instead of something ...
Dogfish's user avatar
0 votes
1 answer
623 views

How do i truncate content length to 500 words?

Hello I would to truncate my post content to 500 words on my single page post Please how can I do this using PHP?
Oluwatemitope Adeala's user avatar
0 votes
0 answers
750 views

Get First paragraph only (from page)

im trying to get just first paragraph from about page to home page went through some code on internet but didnt help at all function get_first_paragraph(){ global $post; $str = wpautop( ...
syner's user avatar
  • 11
0 votes
1 answer
152 views

Some pages can't be updated - post_content field not updating

Background: (Site is running most recent version of WordPress on DreamHost.) This all seems to have started when I tried to get our WordPress site over to SSL. I had a certificate but going to https:...
bitterleaves's user avatar
1 vote
0 answers
120 views

Bulk append custom field to post content

I want to bulk append my custom field named 'LINK' (with data like 'http://domain.com') to the end of the post content, so I can go back to using a standard theme with no support for custom fields. ...
Decio's user avatar
  • 11
0 votes
0 answers
1k views

Wordpress MySQL Search and replace with wildcard?

I'm trying to search and replace for a link with wildcard in phpMyadmin. If I simulate this query UPDATE wp_posts SET post_content = REPLACE (post_content, '<a style="text-decoration:none" ...
Randomer11's user avatar
1 vote
1 answer
185 views

Adding current user's ID to the end of PDF hyperlinks in post content

How can I add extra parameters after a hyperlink, for tracking purposes? For example, let's say I inserted media into a post - http://mysite/wp-content/uploads/2018/12/My_PDF_File.pdf. How can I make ...
Drastec Development's user avatar
0 votes
1 answer
2k views

Modifying post content with the_post action hook

I'm trying to understand the best way to modify the way that search results are displayed with my custom post type. I've got the search function working properly and giving the correct results and now ...
JLW's user avatar
  • 27
0 votes
0 answers
494 views

Getting 400 Bad request Error when trying to open posts after updating to wordpress 5.0

I have some Wordpress blogs and after updating to Wordpress 5.0, I am getting same error behavior on them. Now When I open the URL of some of the posts, I am getting 400 Bad request error and on some ...
Mr Alihoseiny's user avatar
0 votes
1 answer
297 views

Filter default_content only for products

Is there any way to use default_content only for a certain post type, specifically product (WooCommerce)? My code: add_filter( 'default_content', 'set_default_content', 10, 2 ); function ...
Sergiu Elmi's user avatar
0 votes
1 answer
280 views

Wordpress post_content gets deleted in cron after wp_update_post

I'm developing a Wordpress plugin (integrated with WooCommerce) that fetches HTML Content from an API, and add it to a WP Post as post_content into an iframe, this way: kses_remove_filters(); $...
Kalizi's user avatar
  • 111
0 votes
1 answer
40 views

Gallery shortcode is empty but magically creates a gallery

I have a post with only this [gallery id="file"] in text editor but in visual, there appears a gallery. I was moving these posts and updating gallery ids automatically, but these posts don't have any ...
vtQQ's user avatar
  • 1
0 votes
2 answers
2k views

Website does not reflect changes on live after uploading files via FTP

I have a Wordpress site that is already published on a domain. As I wanted to update the content of some pages, I edited the local version of my website on localhost and then uploaded the files using ...
Has's user avatar
  • 3
1 vote
1 answer
138 views

Redirect All Search Links Containing - to + on Wordpress

I deleted all my wordpress tags via phpmyadmin, and most of my post content contains tag links, now I redirected all the tag links to search using .htaccess, I.E example.com/tag/stack-exchange/ ...
Godwin Alex Ogbonda's user avatar
0 votes
2 answers
591 views

How to display content from post_parent

Not sure what I'm doing wrong here. I am a beginner coder, but I've tried a lot of things already: I'm trying to print the_content from the post_parent of an image. Here's what I'm using right now. I ...
Justin Munce's user avatar
0 votes
1 answer
117 views

Media is not showing on post page

I'm building a wordpress website based on the theme "Bulk Shop". Most of the content will be added as "post" and will be categorized into "next show", "last show", "music", "videos", etc. https://...
Stef Meier's user avatar
0 votes
1 answer
92 views

Delete/Replace words from X to Y in post content

I am looking for a way to search and replace some words in my database. I have many posts on one of my blog and i want to replace words using regexes. before publishing, I marked every place I wish ...
Godwin Alex Ogbonda's user avatar
1 vote
1 answer
1k views

Double or Single Quotes in WordPress Content Conflicting With HTML

so I know about addslashes() and related native PHP functions, but I was surprised that I wasn't able to quickly find a WordPress "catch-all" for this kind of situation, given WordPress' focus on CMS. ...
Summer Developer's user avatar
0 votes
1 answer
630 views

Displaying Post Content on tooltip

I'd like to display the content of a custom post type, when hovering over a "question mark icon". In order to get the data, I used the following code (series is the custom post type): ...
sonja's user avatar
  • 159
32 votes
3 answers
31k views

Check what Gutenberg blocks are in post_content

I'm working on a design that has different styling if a certain Gutenberg block is present on a page. In other words, if the first block is a custom built Gutenberg block, the post_title is rendered ...
Jebble's user avatar
  • 837
1 vote
2 answers
3k views

Get and Trim Full Post Content in WP Query

Simple task, but it isn't working: <?php $content = apply_filters( 'the_content', get_the_content() ); $contentWithoutHTML = wp_strip_all_tags($content); $pos = strpos($contentWithoutHTML, " ", ...
Summer Developer's user avatar
1 vote
0 answers
174 views

current post index within content.php

I have a custom post type 'projects', I would like to add a post counter ('current project index' / 'total number projects') I would like this to show within the post content, but not sure how to ...
Louis Mateu's user avatar
0 votes
1 answer
436 views

Issue with wp_insert_post() when post_content contains links?

When I create a post using wp_insert_post() if the post_content contains an HTML link I'm getting a copy of the post_content in the <head> and the <body> of my post HTML page. The strange ...
zcleft's user avatar
  • 61
1 vote
1 answer
1k views

WP_Query() order by post content lenght?

How do I order a post query by the length of the post content? $orderby = ?; $query = array( 'posts_per_page' => 10, 'post_status' => 'publish', 'orderby' => $orderby, 'order' => ...
Elvin S.'s user avatar
4 votes
3 answers
5k views

WordPress REST API - JSON "Rendered" Content Incorrect

i'm working in android application that use wordpress rest api to get blog from website to , i don't have any knowledge about php or wordpress , but i take some time to learn about it , any way my ...
monsieur Moumni's user avatar
1 vote
1 answer
7k views

$content = $post->post_content; with formating

I'm trying to get formating but with no luck. My code looks like this global $post; $content = $post->post_content; And to output here <div class="tribe-events-single-event-description tribe-...
BoyIsBadNews's user avatar
0 votes
1 answer
6k views

How to implement content from external database into Wordpress text page? [closed]

What methods exist to implement data values from external database into a Wordpress text page? I think that there are two possible ways but maybe there are some more ways to realize this? Maybe ...
Peter's user avatar
  • 147
2 votes
0 answers
769 views

Is there a better way to programmatically insert content into a page?

During activation of the plugin I'm writing, I insert a custom page. I can add post_content using the wp_insert_post command, which seems like a reasonable way to add a limited amount of content. For ...
tim.rohrer's user avatar
1 vote
0 answers
41 views

Auto-create a post with last 10 images in WordPress directory

I want to create something to help me auto-create a post with 10 last images hosted in some directory (in my server or WordPress), this code I found helps to post an image but not many images if ...
Khalid Mayson's user avatar
0 votes
2 answers
1k views

Removing Extra Caption tag around image on post of WordPress

I am facing an issue when i use get_the_content() function. It displays the post content but the image in beginning of the content has some extra text around. My code is: <div class="thecontent" ...
Noman Ahmad's user avatar
0 votes
1 answer
307 views

Some Post Content Does Not Show Up In DB Search

I am using MySQL Workbench to search for URL's in my DB, in order to use sql's update() to change them to a different URL. Easy enough. What bugs me is even then, some of these URL's, nearly all of ...
yonkyonk's user avatar