King Vivekvardhan had only one wish — that his people should always live in peace and happiness. Yet he often wondered: how could he truly make his subjects happy? To find the answer, he summoned his wise ministers and advisors.
Continue reading “He Asked How to Make His People Happy — The Sage’s Answer Changed Everything”Author: allaboutbasic
Remove duplicate images with same name and url but different ids from wordpress media library

Add the code below to your theme’s functions.php or use Code Snippet Plugins. Then Go to Tools > Duplicate Media in your WordPress admin, Click “Find Duplicates” to see what would be affected. Backup your Site and Media first, then click “Remove Duplicates”
Check if it is mobile then show something : wordpress template php code
For coders sometimes it is needed to show something only for mobile in template fiile. So here is the coding
for functions.php file
function is_mobile_device() {
$user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
$mobile_agents = ['Android', 'iPhone', 'iPad', 'iPod', 'Windows Phone', 'BlackBerry'];
foreach ($mobile_agents as $agent) {
if (stripos($user_agent, $agent) !== false) {
return true;
}
}
return false;
}
in template file ( like single.php, page.php etc)
<?php
$is_mobileb = wp_is_mobile() || is_mobile_device();
if( $is_mobileb){
?>
YOUR CODE WILL GO HERE
<?php } ?>
Change woocommerce mail template’s footer background ,text color and font size
So i wanted to change the woocommerce mail template’s footer background color, font size and font family ( screen shot below). I have shared the code too which i used
Continue reading “Change woocommerce mail template’s footer background ,text color and font size”Left Side Image and Right side content in wordpress gutenberg editor
Here you can see my 2:32s video where i have tried to show how you can create content with left side image and right side content using gutenberg editor and you dont need to use html/css for this.
Three images side by side in wordpress gutenberg editor
If you want to show 3 image side by side in guentberg editor, here you can see a 1.28s video i have created.
WordPress Shortcode to Show Different Images for Desktop & Mobile
Basically client was asking to show different image in desktop view and mobile view. So the idea which hits in my mind to create a shortcode which will check if client is visiting the site from mobile or from desktop/laptop and return the image based on it
So the shortcode need to be used in the following way, put it in the img html tag where u want to show the different image
Continue reading “WordPress Shortcode to Show Different Images for Desktop & Mobile”Shows number of Word Count at the bottom of page or post in wordpress
Without using any plugins if u want to show the number of words used in a page or post at the bottom, you can use the following code in function.php
function count_words( $content ) {
$stripped_content = strip_tags( $content );
$wordnum = str_word_count( $stripped_content );
$label = __( 'Number of Words', 'wordcount' );
$content .= sprintf( '<h2>%s:%s</h2>', $label, $wordnum );
return $content;
}
add_filter( 'the_content', 'count_words' );
Here is the result
Continue reading “Shows number of Word Count at the bottom of page or post in wordpress”Macbook air m1: connect to github using terminal
The whole procedure i took help of Claude AI.
First, create a new Personal Access Token:
- Go to GitHub.com and login
- Click your profile picture → Settings
- Scroll down to “Developer settings” (bottom of left sidebar)
- Click “Personal access tokens” → “Fine-grained tokens”
- Click “Generate new token”
- Set a token name: “MacBook Git Token”
- Set expiration: 90 days (or as you prefer)
- Under “Repository access”, select “All repositories”
- Under “Permissions”, expand “Repository permissions” and select:
- “Contents” → “Read and write”
- Click “Generate token”
- COPY THE NEW TOKEN AND SAVE IT SOMEWHERE SAFE
How to remain Calm when someone Praise or Criticise you
When others honor a seeker, they should not attribute it to their own deeds, virtues, or goodness. Instead, they should recognize that the praise reflects the courtesy and generosity of the one offering it. Considering another’s politeness as one’s own merit is not an act of honesty.
Conversely, if someone insults them, they should accept it as a consequence of their own actions, acknowledging that the fault lies within themselves. The insulter bears no blame; rather, they are deserving of compassion, as they unwittingly provide the seeker with an opportunity for purification by enduring the repercussions of the seeker’s misdeeds.
By adopting this mindset, a seeker can remain calm and indifferent to both honor and insult. However, if they perceive honor as a result of their own virtues and insult as another’s fault, they will struggle to maintain tranquility in the face of praise or criticism.
Collected from Gita Press Gorakhpur book Gita Sadhak Sanjivani (English)
