Shivam Pandey
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [GeneratePress] How to Disable Right Click in GeneratePress?First of all, Thank you, David, I greatly appreciate your help!
The above PHP snippet and CSS are working like a charm! ??
But David, I have already installed 20+ plugins and I have already told you. I don’t want other plugins and I want to remove plugins one by one When I find alternative options. To use this custom function, I need to install the Code Snippets plugin so I have made some changes.
First, I create a new Hook Element. And add the script like this:
<script>document.addEventListener('contextmenu', event => event.preventDefault());</script>
and set the hook to
wp_footer
then set the Display Rules to “Entire Site”.After that, I add the below CSS code in Appearance > Customize > Additional CSS.
html { -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; }
Finally, I achieve my desire result. The right click and copy and paste are now disabled. now users can’t steal my content.
David, I want to ask one last question. Have I followed the correct method to disable right click and copy and paste? because I get the desired result without installing the “Code Snippets” plugin.
Forum: Themes and Templates
In reply to: [GeneratePress] How to Disable Right Click in GeneratePress?David, I have added this custom function to my site but this code is not working properly. Your code only disables right click, but not the Copy (CTRL + C) and Paste (CTRL + V).
Please help me to fix this problem.
Leo, I’ve tried to edit the logo directly, but nothing happens. So please provide any css code to fix this problem.
Leo, can you please provide any css code to fix this problem? And what is the suggested logo size in pixels for the navigation logo? Please help me to fix this problem.
Leo, I have cleared the website cache. please check again. You can also clear your browser cache or open the website in an incognito tab.
Thank you for your time ??
Yes, I am using WP Rocket Caching Plugin and Cloudflare CDN.
David, As I already told you that I used the responsive AdSense ads below the navigation menu and also used the below CSS code provided by you. but Adsense ad didn’t look like 728×90 sized leaderboard ad. So now I am replacing the 728×90 fixed-size leaderboard Adsense ad code with the responsive AdSense ad code to solve this problem. Thank you for your amazing support, if I face any other problem so I will tell you here ??
body .grid-container.header-advert { max-width: 728px; max-height: 90px; box-sizing: border-box; margin-top: 1em; }
Hello Tom, please understand my problem. I am using a 728×90 fixed-size leaderboard Adsense ad unit below the primary navigation menu. I also tried the responsive Adsense ad unit but the ad is showing too large. It is a single Adsense ad unit on my website which is not responsive. But when I manually visit my website on desktop or mobile, I am not facing any problem that Adsense ads are not behaving responsively. Everything looks good and mobile-friendly. But when I run the “Mobile-Friendly Test”, the preview of the website is not showing properly. You can check the link given below.
https://search.google.com/test/mobile-friendly?id=41sJcmnbRBeUblVUY8pHIQ
How can I fix this problem without changing the 728×90 fixed-size leaderboard Adsense ad into a responsive ad unit? Please help me to solve this problem.
David, can you please tell me which AdSense ad unit is not behaving responsively. So that I can remove it from the website. Please help me to fix this problem.
Hello David, First of all, I would like to tell you that my website is hosted on DigitalOcean Bangalore server because almost all of my traffic comes from India. So if you test the speed of my website from Vancouver, Canada. it makes more requests. but according to you, I have optimized my website speed, now it makes 10-12 requests worldwide and It loads in less than 1.0 second. You can check the link given below.
https://gtmetrix.com/reports/www.wikihelp.in/5DZmrhQB
But still, I have been facing Text too small to read “Page is not mobile friendly” issue for more than 2 months. but When I ran the “mobile friendly test” I noticed that the website preview is not showing properly, you can see the image below.
https://search.google.com/test/mobile-friendly?id=41sJcmnbRBeUblVUY8pHIQ
But when I test other websites, its preview is showing properly. I think this is causing the problem, so please help me to fix this problem.
Leo, can you please share a custom function to show the last updated date in GeneratePress? Because earlier you shared a custom function which was not working on my website. The custom function given below is working for me, but I have some doubts about it. I copied it from a website and made some changes to it as well. Can you please check, is the below custom function code is okay or not?
add_filter( 'generate_post_date_output', function( $output, $time_string ) { $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published: %2$s</time>'; if ( get_the_date() !== get_the_modified_date() ) { $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Last Updated: %4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); return sprintf( '<span class="posted-on">%s</span> ', $time_string ); }, 10, 2 );
Forum: Themes and Templates
In reply to: [GeneratePress] Alignment Problem in GeneratePress !!David, After applying this css code the social media follow widget issue has been resolved but I am facing a problem with the pagination button that the pagination buttons look good on 6-inch or higher screen size phones but Pagination buttons are not showing properly in 5-inch, 5.5-inch, 4.5-inch or lower screen size phones, you can see the image below. please help me to fix the problem.
Leo, I have used CSS code to show the last updated date in GeneratePress. But I have also checked that the last updated date is showing in the HTML markup. But according to you, you suggest to use the custom function to show the last updated date to readers or Google but the custom function you have shared is not working for me so below I have mentioned a custom function which works for me so please check it that the below custom function is ok or not?
add_filter( 'generate_post_date_output', function( $output, $time_string ) { $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published on: %2$s</time>'; if ( get_the_date() !== get_the_modified_date() ) { $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Last Updated: %4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); return sprintf( '<span class="posted-on">%s</span> ', $time_string ); }, 10, 2 );
Leo, after applying the above css code, I got my desired result but when I compare with another website. I noticed that my horizontal lines look bold and the horizontal lines of another website look simple. I don’t want my horizontal lines to look bold so please see the image below and please help me to fix this problem.