get_the_content_feed with paginated posts

If you are talking about paginated posts which created using <!–nextpage–> tag, then you will have to use the_content_feed hook to strip that tag and pass the full content. I have tried below code & it does exactly that. But please note it will pass full content to RSS feed for all the posts. add_action(‘the_content_feed’, … Read more

WP_Query Authors OR Categories

Custom feed slug To create a custom feed slug, e.g. example.tld/billyfeed/ we can use the add_feed() but we have to flush the rewrite rules to activate it. We can do that e.g. by visiting the Permalinks settings page in the backend. To generate the feed we can use e.g. do_feed_rss2() or do_feed_atom(). Here’s an example: … Read more

Modify Image Source With The_Content Filter?

Let’s give it a try: $str=”<img src=”http://myserver.mydomain/picture.png” />”; $pattern =’#<img src=”http://.*/(.*)” />#’; $replace=”<img src=”http://http://i0.wp.com/$1?quality=70&strip=all />””; $result = preg_replace($pattern, $replace, $str); The $pattern is quite simple and very specific. You might need to generalize it a bit more but it should show you the direction to go. E.g. it takes no care of possible whitespace. A … Read more

Alternate row and columns every X posts

First of all you don’t know if you have posts number dividable by 11 in your case, so what will happen if at the end of your loop you end up with let’s say only 3 posts in your first section? Counter won’t reach 7 so your markup will be corrupted because of unclosed tags. … Read more