Scroll to top

Blog

I would like to discuss on whatever your requirement will be. Also I feel pleasure to be a part on that. So let’s just the conversation and finish this in efficient way.

How to fetch file name, extension and basename from url in php?

Fetch file name, extension and basename from url in php <?php $file = ‘http://localhost/brrrr/wp-content/uploads/2019/11/New-Business-card-4.jpg’; $ext = pathinfo($file); echo $ext[‘dirname’] . ‘<br/>’;   // Returns folder/directory echo $ext[‘basename’] . ‘<br/>’;  // Returns

Read More »

How to create logout page with session in wordpress?

Create logout page with session in wordpress <?php session_start(); session_destroy(); session_unset(); //echo ‘<script LANGUAGE=”JavaScript”>window.location.href=”‘.site_url().’”;</script>’; if(!isset($_SESSION[‘ID’])){  echo ‘<script LANGUAGE=”JavaScript”>window.location.href=”‘.site_url().’/login-form”;</script>’; } ?> <script>     location.reload(); </script>

Read More »

How to Create a Custom Page in WordPress?

<?php /* Template Name: myfirstpage */ ?> <?php get_header(); ?> <div id=”primary” class=”content-area”> <main id=”main” class=”site-main” role=”main”> <?php // Start the loop. while ( have_posts() ) : the_post(); // Include

Read More »