Content No Cache | Serve uncached partial content even when you add it to a page that is fully cached.
Normally, if a web page is served by the cache, its content will be always the same until the cache is deleted. By adding the content with the shortcode provided by Content No Cache, you will be able to show dynamic content even on pages served by cache. You don’t need this plugin to exclude the entire page from the cache. This plugin is to exclude a part of the page from the cache. It’s useful if you need to cache a page, but part of that page should not be cached. Imagine you have a page that has this content: Hello this is some text. Another line of text Another line of text Current day: Monday if that page is served by cache, the user will always see: Hello this is some text. Another line of text Another line of text Current day: Monday If you need that the last line of text is always updated, this plugin will help you. The entire page will be served by the cache, but the plugin will get the updated content that you need. How to show dynamic content with full page cache Install Content No Cache Create a new element “Content No Cache” Add to that element all the content that you want to exclude from the cache Copy the shortcode that you will see in the section “Shortcode”. It will look like [content_no_cache id=”3328″]. The parameter “id” is the ID of the content element (in this example 3328). Add the shortcode to the page where you want to display that content. Compatible caching plugins tested with Content No Cache W3 Total Cache WP Fastest Cache WP Optimize Comet Cache Cache Enabler Hyper Cache WP Super Cache LiteSpeed Cache Speed Optmizer WPRocket All of those caching plugins are compatible with Content No Cache. If your favorite caching plugin is not compatible for any reason, let us know it Compatible CDNs Cloudflare BunnyCDN StackPath KeyCDN Fastly CloudFront Main features Ultralightweight plugin. The few lines of code will run only where you add the shortcode. No jQuery, no JS libraries, only a couple of lines of pure JavaScript No database queries, no extra HTTP requests for external assets, no bloat With a few line of ultralight code you can fully cache the page even if you need dynamic content on that page It provides a shortcode, so you can add it everywhere, no matter the builder Tips to speed up the process to get the content Install Freesoul Deactivate Plugins Go to Freesoul Deactivate Plugins => Actions => Content No Cache Disable all the plugins that you don’t need to output the content Example You can see Content No Cache in action visiting the blog post Exclude specific content from being cached. You will see a number that is always different when you refresh the page. But the page is served by full page cache. In the example it’s just a number, but you can output whatever content you want. Possible conflicts Some plugins don’t load the shortcodes during ajax requests. Because Content No Cache retrieves the content through ajax, in those cases the content will not be displayed properly. If you have this kind of issue set the parameter request=”remote”. In this case the shortcode will look like [content_no_cache id=”3328″ request=”remote”] The plugin will retrieve the content in a different way that will be a little slower, but this will solve this kind of conflict. Help If something doesn’t work for you, don’t hesitate to open a thread on the Support Forum Please, before posting enable the debugging in wp-config.php. Need a step-by-step guide? Read this detailed tutorial on how to enable debugging in WordPress to learn more. Backend Speed Optimization Is your dashboard slow? I optimize admin performance by improving queries and plugin load. Read Backend Speed Optimization for more information.
Posts By Tag
Posts By Tag WordPress Plugin, provides sidebar widgets which can be used to display posts from a specific set of tags in the sidebar. These tags can be specified in the widget or the Plugin can automatically retrieve them from the current post tags, post slug or form custom field. The custom fields can be specified in the edit post or page screen. You can also use shortcode or template function to display the posts. The Plugin caches the posts of each widget separately, and issues database queries only when needed. This will reduce the amount of database queries involved for each page load and will therefore be light on your server. If this clashes with other Plugins, you also have an option to disable it. Features Sidebar Widget Posts By Tag Plugin provides a sidebar widget which can be configured to display posts from a set of tags in the sidebar. You can have multiple widgets with different set of tags configured for each one of them. Each widget allows you to choose The set of tags from where posts should be selected (or excluded) The number of posts to be displayed. Whether to pick the tags from current post Whether to pick the tags from current post slug Whether to pick the tags from current post’s custom field Option to enable post excerpts to be displayed with post titles. Option to display post thumbnail if present. Option to display post author. Option to display post date. Option to display post content. Choose the order in which the posts should be displayed. Option to exclude current post/page. Option to specify the target attribute for links Option to display links to tag archive pages. Option to disable the cache if needed. Option to enable Google Analytics tracking on the links To add the widget, log into your WordPress admin console and go to Appearances -> Widgets. You will find the widget with the title “Posts By Tag”. Drag and drop it in the sidebar where you want the widget to be displayed. Template function In addition to using the widget, you can also use the following template function to display posts from a set of tags, anywhere in the theme. posts_by_tag($tags, $options); The following options can be passed in the $options array $tags (string) – set of comma separated tags. If you leave this empty, then the tags from the current post will be used. $options (array) – set of options. The following are the fields that are allowed number (number) – default 5 – number of posts to display tag_from_post (bool) – default FALSE – whether to pick up tags from current post’s tag tag_from_post_slug (bool) – default FALSE – whether to pick up tags from current post’s slug tag_from_post_custom_field (bool) – default FALSE – whether to pick up tags from current post’s custom field exclude (bool) – default FALSE – Where to include the tags or exclude the tags excerpt (bool) – default FALSE – To display post excerpts or not excerpt_filter (bool) – default TRUE Whether to enable or disable excerpt filter thumbnail (bool) – default FALSE – To display post thumbnails or not thumbnail_size (string/array) – default thumbnail – Size of the thumbnail image. Refer to https://codex.wordpress.org/Function_Reference/get_the_post_thumbnail#Thumbnail_Sizes order_by (date,title, random) – default date – Whether to order by date or by title or show them randomly order (asc,desc) – default desc – To change the order in which the posts are displayed. author (bool) – default FALSE – To display author name or not. date (bool) – default FALSE – To display post date or not. content (bool) – default FALSE – To display post content or not. content_filter (bool) – default TRUE Whether to enable or disable content filter exclude_current_post (bool) – default TRUE – To exclude current post/page. tag_links (bool) – default FALSE – To display link to tag archive page or not. link_target (string) – default empty – target attribute for the permalink links. In addition to the above options the following options are available in the Pro addon campaign (string) – The Google Analytics campaign code that needs to be appended to every link event (string) – The Google Analytics events code that needs to be appended to every link You can checkout some example PHP code that shows how you can call the template function with different options. Shortcode You can also include the following shortcode in your blog posts or WordPress page, to display the posts from the set of tags. posts-by-tag tags = "tag1, tag2"] All the parameters that are accepted by the template tag can also be used in the shortcode. You can checkout some example shortcodes that shows how you can use the shortcode with different options. Custom field You can also specify the tags for each post or page and a custom title using custom field. The UI for the custom field is available on the right side of the add/edit post/page screen in WordPress admin console. Styling using CSS The Plugin adds the following CSS classes. If you want to customize the look of the widget then can change it by adding custom styles to these CSS classes and ids. The UL tag has the class posts-by-tag-list Every LI tag has the class posts-by-tag-item Every LI tag also has all tags names to which the post belongs as part of the class attribute Each LI tag also has the id posts-by-tag-item-{id}, where id is the post id. Each tag inside LI that contains title has the class posts-by-tag-item-title. If you want to output categories of the post as class names(so that you can style them differently), then you can get the code from this forum thread. Caching If you are using the widget, then the Plugin automatically caches the db queries. This will greatly improve the performance of you page. If this clashes with other Plugins or if you want to manage the cache yourself, then you disable the cache if needed. However if you are going to use the shortcode or the template directly, then you might have to cache the output yourself. Development and Support The development of the Plugin happens over at github. If you want to contribute to the Plugin, fork the project at github and send me a pull request. If you are not familiar with either git or Github then refer to this guide to see how fork and send pull request. If you are looking for ideas, then you can start with one of the following TODO items 🙂 TODO The following are the features that I am thinking of adding to the Plugin, when I get some free time. If you have any feature request or want to increase the priority of a particular feature, then let me know by adding them to github issues. Provide template tags for widget title, that will be dynamically expanded. Add support for custom post types Ability to sort posts alphabetically Ability to exclude posts by id Ability to show comment count Ability to retrieve posts by date range Ability to pull posts randomly. – Added in v3.0 Support If you have found a bug/issue or have a feature request, then post them in github issues If you have a question about usage or need help to troubleshoot, then post in WordPress forums or leave a comment in Plugins’s home page If you like the Plugin, then kindly leave a review/feedback at WordPress repo page. If you find this Plugin useful or and wanted to say thank you, then there are ways to make me happy 🙂 and I would really appreciate if you can do one of those. Checkout other WordPress Plugins that I have written If anything else, then contact me in twitter. Translation Swedish (Thanks Gunnar Lindberg Årneby) Turkish (Thanks Yakup Gövler) Belorussian (Thanks FatCow) German (Thanks Renate) Dutch (Thanks Rene) Hebrew (Thanks Sagive SEO) Spanish (Thanks Brian Flores of InMotion Hosting) Bulgarian (Thanks Nikolay Nikolov of [IQ Test) Lithuanian (Thanks Vincent G) Hindi (Thanks Love Chandel) Gujarati (Thanks Punnet of Resolutions Mart) The pot file is available with the Plugin. If you are willing to do translation for the Plugin, use the pot file to create the .po files for your language and let me know. I will add it to the Plugin after giving credit to you. Readme Generator This Readme file was generated using wp-readme, which generates readme files for WordPress Plugins.