Skip to content

Instantly share code, notes, and snippets.

@getneerajk
getneerajk / faq.css
Last active November 7, 2023 12:58
FAQ accordion #faq #wp
/* FAQ Section Mobile*/
html{
font-size: calc(100vw * 18/360);
}
.faq-container{
position: relative;
padding-top: 1.667rem;
}
.faq-content{
@getneerajk
getneerajk / validate_comment_email.js
Last active December 1, 2023 04:12
Comment email validation alert #wp #js #comment #email
// comment section email validation start
document.addEventListener('DOMContentLoaded', function() {
var commentForm = document.getElementById('commentform'); // Replace 'commentform' with the ID of your comment form
if (commentForm) {
var emailField = commentForm.querySelector('input[name="email"]');
commentForm.addEventListener('submit', function(event) {
var emailValue = emailField.value.trim();
@getneerajk
getneerajk / si_native_share.php
Last active December 5, 2023 06:45
Native share #wp #nativeshare
<?php
//This function outputs the html for the share button and popup
function si_share_this_page($id,$imgsrc){
?>
<img src="<?php echo $imgsrc;?>" alt="Share icon" id="si-share-button" class="share-icon si-share-button " >
<div class="share-link-popup" id="si-share-link-popup">
<div class="si-share-link-popup-head" >
<p> Share this Page</p>
<button id="si-share-link-popup-close" >X</button>
@getneerajk
getneerajk / upload_size change.php
Last active September 25, 2023 08:55
Filter the upload size limit for non-administrators. #wp #medialibrary
<?php
/**
* Filter the upload size limit for non-administrators.
*
* @param string $size Upload size limit (in bytes).
* @return int (maybe) Filtered size limit.
*/
function filter_site_upload_size_limit( $size ) {
// Set the upload size limit to 10 MB for users lacking the 'manage_options' capability.
if ( ! current_user_can( 'manage_options' ) ) {