0
votes
1answer
58 views

Add Element as a Filter to the_content

Can I and How would I add a filter in the function.php that would add a HTML element around the content when the_content is used? This would be similar to what you can do with the_title. i.e: ...
0
votes
1answer
34 views

How accomplish modification the_content if home/start page?

How can I modify the_content if the page is the home/start page? I thought this could be done through a function in functions.php, but soon realized after some googling that the functions.php -file ...
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
319 views

If is_single in functions.php

I want the remove wpautop filter working only on posts from my blog. Because at some pages i need the autop, and at some pages i need it to not be there. I use the following rule and it is in my ...
1
vote
1answer
237 views

Function to wrap the_content in a div

Whenever I've developing a new theme I always wrap the_content in a div, like so; <div class="entry-content"> <?php the_content();?> </div> Is there a way I can streamline ...
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
187 views

Conditional function for excluding first image from content, not working

I have the following function: function remove_images( $content ) { if( ( is_category() || is_archive() || is_home() ) && has_term( 'MyCat', 'category', $postID ) ) { $postOutput ...
0
votes
2answers
343 views

get_the_excerpt() not returning anything when post has no excerpt

When trying to call get_the_excerpt() the page does not return anything on posts that have no excerpt. I thought WordPress usually 'fake' it and create one using the first x characters from ...
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 ...
1
vote
3answers
2k views

Insert Ad Code in the Middle of a Post

I want to insert an ad code in the middle of a post via functions.php. I found several links but either they don't use functions.php or don't insert the code in the middle. Can anyone tell me how to ...
1
vote
1answer
192 views

Removing permalink from post thumb in twentyeleven

possibly a simple thing to do but I'm not sure how it's done - I want to remove the permalink from a post thumb, in the default twentyeleven theme. Looked through content.php and the other templates ...
0
votes
1answer
830 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 ...