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
1answer
568 views

How to keep before/after text inline with nl2br and the_content()

I have "<em><?php echo nl2br(the_content()); ?></em>" but the two " are not inline with the content. How do I keep the before and after " characters inline?
4
votes
3answers
4k views

How to to stop html editor from addig <p> tags to shortcodes, images, etc

I know this this is covered as individual topics but What I am looking for is a single function that stops <p> tags from being wrapped around via the Wordpress editor to shortcodes and images ...
1
vote
1answer
1k views

why does the add_action('the_content) overwrite my page

I am new to wordpress and I am trying to display some text on specific pages on my website. My problem is that my plugin replaces my current content on that page with the one on my plugin. How can I ...
1
vote
1answer
84 views

How to make search and replace in content through php

I actually can show content and change content while displaying post. Problem is that I am using RSS importer and after importing I want to make search and replace and correct data imported because I ...
0
votes
1answer
1k views

Including Custom fields within the_content

I’m designing a site for a client and I’m using custom fields for buy links to her books. I only want buy buttons to appear for fields that contain a URL, so I’ve hooked this just below the_content: &...
1
vote
3answers
3k views

Get the Page Content,without generating HTML

I want to get the page content (so i can parse the tags/short-codes in it), but i don't want to output the result itself to the browser (i.e. echo=0). I tried get_the_content(); but its the same deal....
0
votes
1answer
66 views

Format content value from DB outside of WordPress filters

We're using WordPress to maintain data for a site that gets feed into a JSON file. I've noticed that the post content we add to our file is not getting formatted appropriately. So when we feed it to ...
1
vote
2answers
1k views

Wrap First Character after </h3><p> in a <span> tag

This is a continuation from a question I asked earlier about doing this with output from the_excerpt(). What I am trying to do is take the following output from the_content() to take the following ...
1
vote
2answers
1k views

How do I Add HTML to the_excerpt() & the_content() Output?

I am building a theme where I need to add a dropcap to the first letter. This would be done by surrounding the character in question with <span class="dropcap> and </span>. The actual work ...
0
votes
1answer
16 views

Is there a way to have chunks of a page's content expire?

I have a page on my site where I post items that have been discounted. However, each item's discount ends at a certain date. After that date, I don't want the item to be visible any longer. But I don'...
0
votes
1answer
47 views

Changing where my author box is printed

I've got a function in my functions.php that compiles author info for an author box. At the end of the function it return $content; I then have it being added to the end of the content like this // ...
1
vote
1answer
820 views

How to have a “clean” post content, for excerpt and social networks sharing

Sometimes I start my blog posts by : This is a guest post.... This is a sponsored post.... [download]This is a download for the post[download] [youtube]this is a video that I put in the begenning[...
1
vote
1answer
890 views

Function the_content not working

I'm developing a site with the Advanced Custom Fields and SF Taxonomy Thumbnail. In any page (post type = page), I'm with an error that I don't know what is happening: My custom template code: https:...
0
votes
1answer
32 views

The post content just showing up text

I am newbie in wordpress. I can't fixed it and I really wonder that. I get the content with "the_content()" function. But if I add the picture, just write the attr (alt) of image or when I use link, I ...
1
vote
1answer
2k views

Replace post's “the_content” with ACF value

I try to replace post's the_content with value from ACF field article_text. I managed to achieve it with following method: $postid = get_queried_object_id(); $my_post = array( 'ID' ...
0
votes
2answers
68 views

Custom signature appears twice on page

I have a simple plugin which adds a signature at the end of each post. But it also appears after user comment section. How to avoid the latter? Update I have tried to run the function once by adding ...
1
vote
0answers
339 views

Add Attribute to p Tag of Post Content

I would like the default <p> elements that are added to the (TinyMCE) editor when users post content, to have a dir attribute as well. Reasoning: When the editor is displayed to users, it is ...
0
votes
1answer
116 views

Only first shortcode gets executed

I am trying to get 2 shortcodes (single-include and single-factsheet) on one page. The Problem is, that only the first shortcode is getting executed. The second shortcode on a page simple returns the ...
0
votes
1answer
200 views

pre_get_comments or the_content filter

What is the best practice to show social icons always on all the posts and pages. Already I am firing pre_get_comments in my functions.php to show a sidebar between the post content and the comments....
3
votes
1answer
1k views

the_content and wp_link_pages

Many plugins seem to be adding a filter/action hook to the_content to display related posts, advertisements and such. The problem is I these appear before the post pagination so it the pagination is ...
0
votes
1answer
18 views

Searching for themes that post full article on home page by default

I understand there is way to change the_excerpt to the_content. But do any of the existing "features" on the search feature (under add new themes) indicates the the_content is already the default ...
1
vote
1answer
1k views

Visual Composer integration [closed]

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 code ...
-1
votes
2answers
80 views

echo statement repeats

Creating first wp plugin. Using add action init with filter for the_content I noticed that whenever I echo anything it appears twice in the header, and finally once in the body. Why? Or How can I ...
0
votes
1answer
5k 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 ...
11
votes
1answer
2k 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 ...
0
votes
1answer
1k views

Insert Content Before div#main from the functions.php File

I know WordPress has a filter for targeting the content in the functions.php file: add_filter( 'the_content') However, is there a filter to insert content BEFORE ? 'the_content' filter puts content ...
2
votes
2answers
2k views

Getting a div content of a post in wordpress?

How can I fetch a div content from a post? Using the_content() can fetch all the data but instead of that, I need specific content from the div only. So far, all I could do was get the link of the ...
0
votes
1answer
1k views

How can i specify the size of the image rendered by the_content();?

I can do it manually like this: echo get_the_post_thumbnail($post->ID, 'large'); But how can i set the size of the image rendered by the_content(); to Large too ?
0
votes
1answer
46 views

Why is this array not working?

So first I am trying to get all pictures from content to take first picture from content and set it as features image if such is not set. I found part of thi online, it seems that this makes loop ...
0
votes
1answer
5k views

Cannot retieve the_content() and the_author() - both returning empty strings

I am creating the following code to display open graph meta data in the header of my single.php page add_action('wp_head', 'mycode_add_og_meta_tags', 5); function mycode_add_og_meta_tags () { ?> ...
0
votes
2answers
264 views

Single.php the_excerpt loads same as the_content not loading read more line

Currently I'm using the the_excerpt on my frontpage which works perfectly. When the visiter goes to the post it first needs to read the first part of the story, see a featured image and then load the ...
1
vote
2answers
2k views

Filter only the text in the_content

I tried to filter only the text in get_the_content for my home page, but its including my shortcode also, because in that page first row google map 2nd row text box i am using visual composer page ...
0
votes
2answers
1k views

Can i use multiple 'the_content' filters?

I am currently using a 'the_content' filter to add some HTML to the bottom of my posts and pages. But, I want to add another 'the_content' filter to a handful of specific pages (using page IDs). Is ...
0
votes
1answer
976 views

Shortcode to eliminate <p> and replace </p> with <br>

I have a filter that removes opening p tags and replaces closing p tags with a br tag sitewide. The client would like this filter in a shortcode that they can use only on specific portions of the site....
0
votes
0answers
138 views

Filter the_content() to add custom figure tags

I'm trying to implement 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
1answer
81 views

How is WordPress changing the content markup?

In my post there is Visual and Text tabs. I've formatted some content and in the text tab it looks like this: <strong>The Mission Statement –</strong> The following is a mission ...
6
votes
2answers
731 views

Insert Custom HTML After Shortcode

The scenario is that I need to add an HTML banner under a slideshow which is a shortcode in the homepage content. I personally hate adding a bunch of div tags to the TinyMCE editor so I'm trying to ...
1
vote
2answers
2k views

put the content of a single post into og:description

I'd like to have the content of the current single post loaded into the og:description meta property - but the '. $content .' doesn't output anything? This is what's in my header.php if (is_single())...
0
votes
4answers
6k 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
1k views

'the_content' filter removing html tags from post content

I have a post content(html) like this: <div id="home_tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin ...
0
votes
1answer
67 views

How to add content with a filter when there's no content in the editor

I'm building a plugin to create page sections (with ACF and repeater field) and I want to add the sections at the end of the content. The sections are added to the content, but only when there's ...
3
votes
1answer
161 views

Add post/page ID to inserted links within the_content

Within the main content editor of posts and pages, we can insert multiple links to other posts/pages: <a href="http://example.com/hello-world/">Hello World</a> What I am trying to do is ...
0
votes
1answer
2k views

Change Content for Specific Page

I want to be able to replace a page's content if it is a very specific page. Here is what I've written so far: function signup () { global $post; $slug = $post->post_name; if (...
5
votes
2answers
5k views

Where to hook into post content?

Which hook or filter is used to edit the post content before the_content filter is applied to it. For instance, if I wanted to add Hello World, as the first text in every post.
0
votes
1answer
192 views

Cannot Find Hook that is changing the_content()

I am working with a wordpress theme that is using Foundationpress as it's starter theme. When I use the_content() all img tags have there css class replaced with image. This is overwriting the ability ...
2
votes
2answers
6k views

get_the_content not working in loop?

I am trying to modify my loop to save post data by category. I found some code on this site that saved the post's titles based on their categories and tried to modify this to save the post's content. ...
3
votes
1answer
2k views

Apply the_content filter for specific post types only

I'm trying to modify a snippet of code I found here for a wordpress website: http://support.membermouse.com/support/discussions/topics/9000007386 Here is the code: <?php add_filter( 'the_content',...
0
votes
3answers
186 views

WordPress Load Only Page Text

I'm working on a page template and I need the_title to be separate from the page text. I'm not sure how to load the_content without it having the title. Can anyone help?
5
votes
1answer
5k views

Add something to beginning of the content

I'm using add_action('the_content', 'myFunction', 10) to append data to the end of the content. How can I place content at the beginning of the content?
0
votes
2answers
1k views

Display specific page (that is child) content on parent page

I have problem displaying child page content on parent page (both static). I can display other page content but only if on same level. It dosent work in relation parent - child. <?php $...

1
3 4
5
6 7
11