WordPress How To Switch Theme Dynamically by URL

I want to switch my WordPress theme dynamically where if my visitor visits a specific URL they will see different theme while my main theme is still the same for other URLs.

All Other Pages will Show Main Theme Like Below

wordpress switch theme dynamically - original theme
wordpress switch theme dynamically – original theme

 

Only for Page wordpress-how-to-switch-theme-dynamically-by-url/ will show below Theme

wordpress switch theme dynamically - different theme based on url
wordpress switch theme dynamically – different theme based on url

 

WordPress Hook to Change the Theme

You can do it by using pre_option_{$option} hook. In this case:

This hook will filter the value of an existing option before it is retrieved.

You can refer the pre_option hook here.

The Code to Change WordPress Theme Dynamically

Don’t Put The Code at Your Theme files

It doesn’t work if you put the code at functions.php or in any files under your theme folder.

You must put at a plugin.

Side Effect by Switching WordPress Theme Dynamically

By switching the theme dynamically, I noticed that:-

  1.  The my top main menu doesn’t appear. I don’t how to solve this yet.
  2. Google AdSense also seems not loaded
wordpress switch theme dynamically - top menu not appear
wordpress switch theme dynamically – top menu not appear

How To Kill Coackroaches at Your House Effectively

Previously, lots of cockroaches having a good stroll at night at my kitchen.

I tried few ways such as using poison gel, cockroaches traps and lemongrass but all of them are not effective.

Then I tried cockroach poison power that I bought at Lazada and put it where the cockroaches will go and have a good stroll. haha

This poison powder is really effective. When I first started put the powder, it seems there were hundred and hundred of dead cockroaches. Slowly the number of dead cockroaches going down because their population becoming less and I see no more cockroaches going here and there at night.

cockcroach powder poison bait
cockcroach powder poison bait

Suitable Places to Put the Cockroach Powder Poison  / Bait

1. Under the kitchen drawer
2. Under the fridge
3. Under the washing machine

 

put the powder under the kitchen cabinet drawer
put the powder under the kitchen cabinet drawer

Amount of Cockroach Powder Poison

cockroach powder poison under the kitchen cabinet drawer
cockroach powder poison under the kitchen cabinet drawer

No need to put a lot, just small amount of it is enough. Importantly put to places where the cockroaches will go.

The Dead Cockroaches after eating the Poison

died cockroaches under kitchen cabinet drawer
dead cockroaches under kitchen cabinet drawer
died cockroach after eating the powder poison
dead cockroach after eating the powder poison

Regularly Change the Powder Every 2 to 3 Months

Ensure you change the powder every 2 to 3 months. Before this, I change after 6 months and I noticed the cockroaches are becoming more and more. Again they are having their night strolls. After I change for every 2 to 3 months, I didn’t see  them anymore.

You can buy the Powder Poison at Shopee

Last time I bought the powder poison at Lazada RM20 for 50 packets but the listing has been taken out.

serbuk racun lipas yang dijual di Shopee
serbuk racun lipas yang dijual di Shopee

 

 

 

 

Cara Bunuh Lipas di Rumah Yang Efektif

Sebelum ini rumah saya lipas mula berkeliaran pada waktu malam terutama sekali lipas yang kecil.

Saya telah mencuba pelbagai cara seperti racun lipas gel, perangkap racun lipas dan juga meletakkan serai. Semua cara ini tidak berkesan.

Jadi saya mencuba membeli serbuk racun lipas di Lazada dan letak di tempat-tempat yang biasanya dikunjungi lipas seperti di bawah drawer kitchen cabinet.

Serbuk racun lipas ini sangat efektif. Pada mula-mula saya letak, macam beratus lipas yang mati. Kemudian lipas yang mati semakin sedikit kerana populasi lipas semakin berkurangan.

Tempat-tempat yang Sesuai untuk Letak Racun Lipas

1. Bawah drawer kitchen kabinet
2. Bawah fridge
3. Bawah mesin basuh

Serbuk Racun Lipas Yang Diletak

Tidak perlu letak banyak sangat hanya perlu letak sedikit.

Lipas-lipas yang Mati selepas makan Racun Lipas

died cockroaches under kitchen cabinet drawer
died cockroaches under kitchen cabinet drawer
died cockroach after eating the powder poison
died cockroach after eating the powder poison

Tukar Serbuk Racun Lipas setiap 2 ke 3 bulan

Pastikan anda tukar racun lipas setiap 2 ke 3 bulan. Sebelum ini saya tukar serbuk racun lipas selepas 6 bulan tetapi saya perasaan lipas semakin banyak. Selepas saya tukar setiap 2 ke 3 bulan lipas berkurangan semula.

Beli di Shopee Serbuk Racun Lipas

Hari tu saya beli di Lazada RM20 untuk 50 paket tapi produk tersebut telah dikeluarkan dari Lazada. Jadi saya bagi pautan di Shopee.

 

serbuk racun lipas yang dijual di Shopee
serbuk racun lipas yang dijual di Shopee

Jalan Berlubang di Genting Permai Selesai Selepas Campur Tangan dari YB Young Syefura Othman

Saya telah membuat laporan berkaitan jalan berlubang di Genting Permai kepada Majlis Perbandaran Bentong (MPB) pada tahun 2020.

Malangnya tiada tindakan dari MPB selepas setahun lebih. Mungkin kerana Covid-19 menyebabkan kerja-kerja pembaikan lambat tetapi bila saya laporkan jalan berlubang di Shah Alam, Majlis Bandaraya Shah Alam hanya mengambil masa satu bulan untuk baiki jalan walaupun masa itu berlaku Covid-19 pada tahun 2020.

Selepas itu walaupun tiada tindakan tetapi tiket laporan telah bertukar status ke selesai. Saya ingat memang selesai tapi bila tengok jalan masih berlubang.

Saya terpaksa meminta bantun YB Young Syefura untuk menggesa MPB mencepatkan pembaikan jalan kerana jalan berlubang semakin teruk.

Alhamdulillah, YB Syefura menjawap dengan cepat dan selepas 3 bulan mengadu kepada YB Syefura, MPB telah membaiki jalan. Saya sangat berterima kasih kepada YB Syefura atas tindakan beliau. Selepas jalan dibaiki PA YB Syefura, Mandy telah menghubungi saya untuk mengesahkan jalan telah dibaiki. Perkhidmatan yang baik dari pejabat YB Syefura.

Teruskan usaha menjaga kawasan DUN Ketari,  YB Syefura!

Kronologi

1. Laporan pertama dibuat pada Oktober 2020.
2. Laporan kedua dibuat pada Mac 2021
3. Email kepada YB Syefura mohon campurtangan pada Disember 2021.
4. Jalan telah diturap semula pada bulan Mac 2022.

aduan jalan berlubang ke majlis perbandaran bentong oktober 2020
aduan jalan berlubang ke majlis perbandaran bentong oktober 2020
aduan jalan berlubang ke majlis perbandaran bentong mac 2021
aduan jalan berlubang ke majlis perbandaran bentong mac 2021
majlis perbandaran bentong - aduan ke YB Syefura
majlis perbandaran bentong – aduan ke YB Syefura
majlis perbandaran bentong - jalan berlubang telah diturap semula
majlis perbandaran bentong – jalan berlubang telah diturap semula

Tindakan Susulan dari Pejabat YB Syefura

majlis perbandaran bentong - maklumbalas dari Mandy PA YB Syefura
majlis perbandaran bentong – maklumbalas dari Mandy PA YB Syefura

 

Tukar Frame Pintu Kayu Yang Reput

Frame pintu kayu  ataupun bingkai pintu kayu tandas saya telah reput. Ini kerana terdedah dengan air selepas bertahun lamanya.

frame pintu kayu reput sebelah kanan bawah
frame pintu kayu reput sebelah kanan bawah

Untuk frame pintu baru saya memilih jenis besi supaya lagi tahan lama.

Mengukur Frame Pintu Lama

Untuk tukar, mula-mula kontraktor akan ukur dulu frame pintu kayu untuk memastikan sama ada saiz adalah standard atau pun perlu tempah khas.

Frame pintu saya adalah standard jika tidak akan mengambil masa lagi untuk disiapkan kerana perlu menempah dengan kilang.

Pemasangan Frame Pintu Yang Baru

Selepas itu frame pintu kayu yang lama perlu ditanggalkan sebelum memasang frame pintu besi yang baru.

Pemasangan pintu frame besi yang baru memerlukan simen dan ini membuatkan rumah berhabuk.

Saya meminta kontraktor untuk mengecat warna krim frame pintu besi untuk memastikan lagi tahan lama dan sama warna dengan pintu sedia ada.

pemasangan bingkai pintu besi yang baru menggunakan simen
pemasangan bingkai pintu besi yang baru menggunakan simen
tengah cat frame pintu besi yang baru
tengah cat frame pintu besi yang baru
frame pintu besi yang telah dicat warna krim
frame pintu besi yang telah dicat warna krim
masa pasang frame pintu besi yang baru mozaik terpecah sedikit
masa pasang frame pintu besi yang baru mozaik terpecah sedikit
frame pintu kayu yang reput dibuang
frame pintu kayu yang reput dibuang

Kos Pemasangan

Kos tukar frame pintu besi, pemasangan dan cat ialah RM750. Saya menggunakan perkhidmantan AZ World Tech Solution iaitu kontraktor yang saya biasa guna untuk segala wiring dan aircond saya.

No telefon: 017 376 0530

TM Unifi 24 Hours Restoration Guarantee or RM50 Rebate

I received my RM50 rebate from TM because TM was unable to restore my Unifi within 24 hours.

Service Down for More Than 24 Hours

My TM Unifi was down for more than 24 hours due to cable cut on 28th January and it was only up by 30th January 2022.

On 4th February, I received SMS from TM stating that I was eligible to get RM50 rebate. I just need to login to myUnifi mobile application and claim the rebate by clicking on 24 hours restoration guarantee banner.

Telekom Malaysia 24 hours restoration guarantee SMS received
Telekom Malaysia 24 hours restoration guarantee SMS received

Unable To Find Rebate As Stated in the SMS

Unfortunately when I clicked on the 24 hours restoration guarantee banner, I didn’t see any rebate voucher.

TM 24 hours restoration guarantee click
TM 24 hours restoration guarantee click

 

TM 24 hours restoration guarantee - no rebate available
TM 24 hours restoration guarantee – no rebate available

 

Contact TM Customer Service Support

I sent my SMS screenshot and myUnifi app no rebate available screenshot to help@tm.com.my. TM was quick in responding to my complaint.

 

TM 24 hours restoration guarantee - RM50 rebate received
TM 24 hours restoration guarantee – RM50 rebate received

TM Did Manual Adjustment

TM did call me try to resolve the problem via phone when they were unable to do it, they manually deposited RM50 rebate into my Unifi account.

TM 24 hours restoration guarantee - RM50 rebate received
TM 24 hours restoration guarantee – RM50 rebate received

Conclusion

I was happy as the 24 hours Restoration Guarantee is not an empty promise and TM did their best to resolve my voucher problem.

Bootstrap 5 Carousel Caption Outside of Image

By default Bootstrap 5, put the caption on the image and no way you can change the caption position by modifying only the Bootstrap CSS.

You need to change the CSS and add jQuery to do this.

After few tries, I manage to do put the carousel caption outside of images for large screen. For small screen the caption is still on the image.

For small screen, to make the caption outside of image, you can change the CSS by using CSS media screen.

bootstrap 5 carousel caption outside image
bootstrap 5 carousel caption outside image

Demo – Bootstrap 5 Carousel Caption Outside Image

How To Change Bootstrap 5 Carousel Caption Position

CSS Not to Display Default Caption Position

Add CSS to Display New Carousel Caption Position

You can change the CSS to where you want to put your text.

Add jQuery Script to Retrieve Current Caption

Add id to each carousel-caption

Full Source Code

How to Fix Submitted URL marked ‘noindex’ from Google Search Console

I found my website have 40+ URLs marked ‘noindex’ from Google Search Console.

What Does it mean?

It means that Google found your URL on your website but not included it in Google search results.

Where You Can Check ‘noindex’ Error?

Login to your Google Search Console and click Coverage then click on Submitted URL marked ‘noindex’

Google search console - coverage and click on submitted URL marked noindex
Google search console – coverage and click on submitted URL marked noindex

How it happens – Submitted URL marked ‘noindex’ error?

Your website generate a noindex meta either at your web page or at your website  HTTP response. It is telling Google not to index your website.

In my case this is my web page HTML that has ‘noindex’ meta tag.

view source on browser to look for noindex
view source on browser to look for noindex

When I checked HTTP response there is no ‘noindex’ in the header.

http header response check
http header response check

You can use website that provide HTTP header checking. In my case I use keycdn.

Why This Error Happens at My Website?

In my case, I use WordPress Elementor theme where accidentally marked the page as noindex and Elementor added the ‘noindex’ to the meta tag.

Google search console - url is not on google indexing errors
Google search console – url is not on google indexing errors

Add Your URL to Google Index @ Into Google Search Results

Double check whether ‘noindex’ is removed after you remove the ‘noindex’ either from meta or HTTP response.

Only then you request indexing from Google Search Console.

google search console - indexing requested
google search console – indexing requested
Google search console - successful indexing
Google search console – successful indexing

Google indexing request is rejected if Google still finds ‘noindex’ tag at your URL.

Google search console - indexing request rejected due to noindex
Google search console – indexing request rejected due to noindex

Successful Google Indexing

After a week when I check the ‘noindex’ error have only 2 URLs where these 2 URLs I don’t want Google to index them.

Google search console - URL marked noindex errors reduced
Google search console – URL marked noindex errors reduced

How To Cancel CIMB Property Fire Insurance

I have a housing loan with CIMB so one of their requirement is to send them every year a fire insurance certificate of my apartment. Usually they will send email reminder but last year they didn’t.

I take fire insurance under my apartment JMB because it is much cheaper around RM70 only vs CIMB fire insurance around RM238.

I noticed in January, CIMB charged me the fire insurance to my housing loan account because I didn’t send them my fire insurance certificate that I took with my apartment JMB.

How To Cancel The Fire Insurance

Send your JMB fire insurance certificate or other fire insurance that you take with other insurance company to csa.insurance@cimb.com

Please include your name and housing loan account with CIMB.

cimb fire insurance - email to csa.insurance@cimb.com
cimb fire insurance – email to csa.insurance@cimb.com
cimb fire insurance property - reply
cimb fire insurance property – reply

How Long It Takes for CIMB to Cancel the Fire Insurance Charges?

It takes around 1 month, as I send my cancellation request on 22th January 2202 and the charge is reverted back by 22nd February 2022.

Red circle: the fire insurance charge by CIMB
Green circle: the reverse payment from CIMB

The good thing CIMB refunded the full amount.

cimb fire insurance charge and reverse payment
cimb fire insurance charge and reverse paymentCO

WordPress add wp media

I want to add a media screen to upload photos to a custom post type. I did search the internet but found the solutions were bit an pieces.

What I plan to do – Add Media Screen to Custom Post Type

1) When click on the Add Media – media screen will apppear
2) User can select a photo and when a photo is selected, it will replace the previous photo.

wordpress - add wp media screen to a custom post type
when click on the add media button, a media screen will appear
wordpress - media screen appear on custom post type
media screen appears after clicking on the button.
wordpress - select new photo
wordpress – select new photo
wordpress - new photo replaced the previous one
wordpress – new photo replaced the previous one

How To Do It?

1) Add below javascript

2) Enqueue the script

3) Add this PHP code  to your plugin

Code Explanation

All the codes are self explanatory and with comments. I just want to highlight which code you can change the title of the media screen.

wordpress - wp media change its default title
wordpress – wp media change its default title

 

References:

https://stackoverflow.com/questions/21540951/custom-wp-media-with-arguments-support