3
votes
1answer
43 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
31 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 ...
0
votes
3answers
168 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: ...
-1
votes
1answer
96 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 ...
0
votes
1answer
86 views

how to use custom loop in the_content filter

Trying to use the the below code for my CPT 'state' like add_filter('the_content', 'my_custom_loop'); but the trial and error is not getting me anywhere. I can't use a single-{post_type}.php since i ...
0
votes
1answer
135 views

change the_content images for different sizes (Desktop, tablet, mobile)?

This may be a complicated question so I'll try to explain it as easy as possible. I have three sizes for images in my post (thumbnail, medium, large, 640px, small) and I would like to change the size ...
0
votes
1answer
122 views

the_content() “crashes” for single pages

I have big trouble with the_content() for single.php. Whats my problem? the_content() doesn't give any output on single pages furthermore it crashes (no other PHP code below the function call is ...
0
votes
1answer
32 views

Have multiple loops on a page appear after/between page content

I created a function (in function.php) that allows me to put additional loops for different categories into pages: function custom_summary($atts) { extract(shortcode_atts(array( ...
0
votes
0answers
52 views

Suppress the_content filter in a nested loop

I have some layout changes that are being applied to the_content. I need to do one of two things, but neither is working as expected... either: Pass data to the filter so that it knows if it is a ...
4
votes
2answers
961 views

Split Content and Gallery

Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode ...
0
votes
0answers
31 views

the_content() function in loop-single.php

i need to show to different layout based on featured_image size for that how on can the_content() as per that. if featured_image .size =={ the layout would A } else{ the layout would B } how does on ...
0
votes
2answers
1k views

remove <p> tags from the_content

I've got a post format of Image, and I am running into an issue where the image is being wrapped by a <p> tag. I want to get rid of that tag (specifically on the single.php version) of those ...
0
votes
0answers
459 views

The Loop won't display page or post content

I can't get the page content to appear in my custom wordpress theme. I have an extremely simple version of The Loop, which should just display the title and the content of the current page or posts. ...
1
vote
1answer
542 views

How can i display the content in plaintext

i want to display my excerpt in plaintext. How can i do this? This is my Snippet where i display the content: <?php the_content(__( 'Weiterlesen &rsaquo;','okay')); ?> How i change the ...
0
votes
1answer
273 views

the_content not working on one of two Multisite sites

I have a multisite with two subsites (sub-domain setup) both sites have the same theme, same plugins but the first one is in Hebrew and the Second in English. On certain templates (not all) in the ...
1
vote
2answers
182 views

Output 2 items within the Loop

I have a query that loops through <li>'s and displays the number of <li>'s I have. Is there a way I can make the loop pull 2 <li>'s at a time rather than one? // 5 list items ...
0
votes
2answers
234 views

Strip <p> from <blockquote> or something better?

Looking for some help on something that has me really contemplating not using blockquotes for the moment! I have this code: <?php $show_after_p = 1; $content = apply_filters( 'the_content', ...
0
votes
1answer
286 views

Why does apply_filters behave different inside and outside a loop?

What I want: the array of posts returned by creating $query = new WP_Query($args); Why: to return specific content as a sort of API request in json format, ready to display on another site What I ...
1
vote
1answer
153 views

Loop after page content

I just upgraded to 3.4.2 from 2.9 (i know, i know, but if it ain't broke...) I have page templates that are (or at least were) set up to display the page content first, then start a loop of posts, ...
1
vote
1answer
180 views

Function to show only first instance of shortcode

I need to add a function to my theme to remove additional instances of a shortcode in a post. First off I wonder if i'm approaching this wrong, but I have a theme that is drastically reformats the ...
0
votes
1answer
689 views

Add custom PHP and HTML to the_content()

I am developing a wordpress website on the thematic framework. In my child theme i have made a full width page template called resources.php In this page template i have written custom php code which ...
0
votes
1answer
108 views

In Loop Output Place Custom Field Content In Between Paragraphs

I'd like to place the contents of a custom field or variable in between the second and third paragraphs in the loop on a page template. Is there a way to do this? So for example, on a client's ...
1
vote
2answers
189 views

Combining the_excerpt with the_content

I have some html: <div class="container"> <p class="accent">The first paragraph...</p> <p>The rest of the article...</p> </div> I'd like to put "the_excerpt" in ...
0
votes
1answer
287 views

Help with add_filter('the_content', 'some_function') and multiple matches

I have a site where a user can insert slideshows into a post by entering the shortcode in the content box. He can also add videos by adding the video code in the same box. I need to separate these two ...
0
votes
1answer
196 views

The_content display a different content from a previous loop

I have custom template for my homepage. If i just put the_content(); to this template, nothing else, then it will display my text i entered in my admin panel in the editor. But if i have a different ...
0
votes
1answer
486 views

Problem in replacing the_content with the_excerpt()

I want to add read more to a blog. For that I need to replace the function the_content(). I found it in the loop file and replaced it with the_excerpt() but still posts are being shown of full length. ...
2
votes
1answer
909 views

the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”

Before I call the_excerpt(), the_permalink() displays the correct thing. Afterwards, it does not... <?php global $query_string; //strip out the ...
0
votes
1answer
829 views

How do I pull excerpts from pages?

So I enabled custom excerpts on my pages with this function. add_action('init', 'page_excerpts'); function page_excerpts() { add_post_type_support( 'page', 'excerpt' ); } However, When I enter ...
1
vote
2answers
2k views

Content/Excerpt length control for a specific loop?

Is it possible to control the length of the content or excerpt for a specific query/loop? I have come across the following code, but this changes the length for all excerpts, I want it focused on a ...