Tagged Questions

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

learn more… | top users | synonyms

1
vote
3answers
23 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
29 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 ...
0
votes
2answers
17 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
0answers
21 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 ...
1
vote
3answers
23 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
0answers
9 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 ...
-1
votes
0answers
32 views

Function to remove all classes on images [on hold]

I need to remove css style by the_content single.php Example single.php img src="http//image1" alt="" class="mycss" /> (remove alignnone size-medium wp-image-51) img src="http://image2" alt="" ...
0
votes
2answers
40 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
1answer
23 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
33 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
185 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 ...
0
votes
0answers
21 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
41 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 ...
0
votes
1answer
17 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, ...
-1
votes
2answers
27 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 ...
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, ...
0
votes
0answers
26 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 ...
0
votes
3answers
27 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 ...
-1
votes
1answer
29 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
52 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
29 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
60 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
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 ...
0
votes
2answers
38 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
120 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
48 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
108 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
66 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); ...
0
votes
1answer
75 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
105 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
203 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
71 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 ...
0
votes
2answers
147 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
716 views

Can't get content of all (19) posts - Incomplete Chunked Encoding

I've got some documentation stored in a WordPress install for something I'm developing, and I want to have a pure html, single page version of it in addition to the regular templated version which is ...
0
votes
0answers
59 views

Where should I insert code to dynamically generate page content?

I would like to generate dynamic pages based on a third-party API. However, I'm not sure where in the WP loop to capture the request and generate the content. For example, if a user is requesting a ...
0
votes
1answer
36 views

append PHP function to the_content

I'm using the Jetpack plugin for related items and social sharing. Both of these options filter the_content and append themselves to the end of it. The problem is that I'm using custom navigation in ...
0
votes
2answers
606 views

add_filter the_content in functions.php not working

I want to add_filter for the_content in functions.php of my theme. I have added code which just display echo but it seams that my filter is not applied. function add_mod_hatom_data($content) { // ...
0
votes
1answer
34 views

Checking post content for a shortcode, but content is being returned as empty

Alright so I am trying to check for a shortcode in the post content so that I can enqueue scripts as necessary. I have this: if( plugin_has_shortcode() ) { // Load CSS ...
0
votes
2answers
228 views

the_content of template page

When I use the_content in the page-template doesn't show anything. Loop to call the page-template in the index: index.php <?php /** * Main template file * * This is the most generic template ...
0
votes
3answers
923 views

Use the_content outside the loop

I was trying to get first 100 words of the content in the header, and I use the following snippet to get the first 100 words in the loop, but is it possible to get the value outside the loop: ...
0
votes
1answer
129 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: ...
0
votes
1answer
86 views

Why is get_the_excerpt returning full content

I have my home page set to a static page with a custom page template. Here I want to show posts, but just the excerpts with a "Read more" link. I want to use the more tag, which is a part of wordpress ...
-1
votes
1answer
248 views

Excerpt all post content Content Same Size without word cutting off

On my category page there are list of 24 posts with title and excerpt content. To display specific lengths of content, I am using substr function. Now the issue is that each post excerpt content are ...
-1
votes
1answer
31 views

I want a part of the_content be under custom post types

On my homepage I have put some information on the page in wordpress. I show this content with the_content();. I also have 3 different custom post types that show under this content which is what I ...
3
votes
2answers
262 views

Heartbeat API oEmbed

By default running content through the_content filter automatically checks for oEmbed content. However when returning data through heartbeat_received the filter for oEmbed doesn't seem to work. For ...
1
vote
1answer
65 views

How to show full post?

I'm using this theme for my magazine website. I'm having trouble showing the full content on my blog side. I have tried changing in the php to show_content but it doesn't work. Any suggestions on how ...
1
vote
2answers
142 views

add_filter('the_content', '…') stops pagination from working

I have a function (it deals with using preg_replace_callbackto replace Image URLs with URLs/paths to the uploads directory - lets call it replaceImgUrls()) which is then passed into ...
0
votes
1answer
82 views

How to check if single.php has already called the_post_thumbnail function

I am creating a front end plugin to upload images and adding filter in the_content() to display post thumbnail but some templates already have the_post_thumbnail in single.php or loop.php. Is there ...
1
vote
1answer
244 views

the_content() not outputting anything (Advanced Custom Fields)

Hi i'm using the custom post types UI and advanced custom fields plugin and would like to use the default content editor as one of my fields for a custom post type. When i use the_content(); in the ...
1
vote
1answer
1k views

Remove empty lines (&nbsp;) when author updates their post

Whenever adding an empty line between paragraphs using TinyMCE, the &nbsp; character entity is added. How can I strip the content of all instances of this character whenever an author updates ...