zvhipp
Forum Replies Created
-
Forum: Plugins
In reply to: [LiteSpeed Cache] Load JS diferred optionFeature – Will it be possible to add above the fold css option for home page (index.php), category/archive page (archive.php) and single pages separately (single.php).
Thanks
Thank you for responding. I tried it but it didn’t work. I also get this error below one I mentioned.
script.min.js?ver=2.3.3:1 Uncaught ReferenceError: swp_isMobile is not defined at HTMLDocument.<anonymous> (script.min.js?ver=2.3.3:1) at i (jquery.min.js?ver=1.12.4:2) at Object.add [as done] (jquery.min.js?ver=1.12.4:2) at n.fn.init.n.fn.ready (jquery.min.js?ver=1.12.4:2) at script.min.js?ver=2.3.3:1 at script.min.js?ver=2.3.3:1
Forum: Plugins
In reply to: [LiteSpeed Cache] Should wp_is_mobile work propery with mobile cache?Thank you for your reply. I tried turning it off, but it didn’t help much, I will keep playing with the settings and javascript. Some pages I noticed text/html cache was set for 31 days in .htaccess. I updated it with 0.
One question I had was, I use wp_is_mobile to display little different things just for mobile visitors. This was the reason I had enabled separate mobile view even though I have a responsive website. If I turn it off, then due to caching based on the device the page was accessed from, It displayed mobile only part on the desktop too and did opposite on mobile too.
Will wp_is_mobile be reliable with mobile cache enabled?
Thanks.
Forum: Plugins
In reply to: [OneSignal - Web Push Notifications] Exclude on Single.php (Post Pages)I used plugin loader, and it took care of this. Thanks.
Forum: Plugins
In reply to: [Social Login] Javascript always loaded?Thank you. I actually used ‘plugin load filter’ plugin, which allowed me to take care of this. It’s working as I wanted now.
Forum: Plugins
In reply to: [Social Login] Javascript always loaded?I tried putting this in my functions.php file, I replaced account page with !is_single() but it didn’t work. It removed the code from everywhere. Anyway to just keep scripts limited to single.php or where the comment is enabled. It does improve the page loading time by 25%. Thanks
Forum: Developing with WordPress
In reply to: Adsense Between Posts on Category Pages – MultipleThis code below is what I found and worked perfectly for ‘content’ single page. It will be helpful to others.
add_filter('the_content', 'prefix_insert_post_ads'); /** * Content Filter */ function prefix_insert_post_ads($content) { $insertion = 'Your Adsense Code Goes Here'; if (is_single() && ! is_admin()) { return prefix_insert_after_paragraphs($content, $insertion, array(2,8)); } return $content; } // Function that makes the magic happen correctly function prefix_insert_after_paragraphs($content, $insertion, $paragraph_indexes) { // find all paragraph ending offsets preg_match_all('#</p>#i', $content, $matches, PREG_SET_ORDER+PREG_OFFSET_CAPTURE); // reduce matches to offset positions $matches = array_map(function($match) { return $match[0][1] + 4; // return string offset + length of </p> Tag }, $matches); // reverse sort indexes: plain text insertion just works nicely in reverse order rsort($paragraph_indexes); // cycle through and insert on demand foreach ($paragraph_indexes as $paragraph_index) { if ($paragraph_index <= count($matches)) { $offset_position = $matches[$paragraph_index-1]; $content = substr($content, 0, $offset_position) . $insertion . substr($content, $offset_position); } } return $content; }
($content, $insertion, array(2,8) – Here is where you can make the change – code here is set to show adsense after 2nd and 8th paragraph.
- This reply was modified 7 years, 8 months ago by zvhipp.
Forum: Themes and Templates
In reply to: [Hemingway] Full-width imagesYou should find a div id or class for your post and add image class width:100% to it. example – .posts img {width:100%;} which will make images in post 100% width of the page.
.content.full-width .posts img {width:100%;} < try playing with div codes.
Forum: Themes and Templates
In reply to: [Hemingway] Full-width imagesimg {
max-width: 100%;
height: auto;try replacing it with width:100% only. It should work.
I can’t also see daily popular posts in admin or even on front end list is not being generated after update.
Thanks for quick implementation.
I am also getting this but this was caused due to sharebar twitter button. Just go to sharebar if you are using it, and edit twitter button and remove text Twitter from it.
Forum: Fixing WordPress
In reply to: Show Different Size Post-Image on Index, Category than Single Pageyes, content image, I have set content to 400 words to display on home/category pages using post limit plugin. I can use that plugin option to strip images and replace with post thumbnail. Only thing was I was trying to do this while already have 80 some posts so thought there may be other way inserting some code in functions.php which will change size automatically.
But will try this way suggest. Thanks
Forum: Fixing WordPress
In reply to: Show Different Size Post-Image on Index, Category than Single PageHI, its not for featured/post thumbnail. Just regular image in post. For example, If I am displaying whole post even on home/category pages. Than it would show regular images in post which were inserted in paragraphs, those Image sizes.
Thanks.
and also, display it on side of image instead letting it stretch over image.