Skip to content

Instantly share code, notes, and snippets.

View MrJSdev's full-sized avatar
🎯
Loading JS

Riyaz Khan MrJSdev

🎯
Loading JS
View GitHub Profile
@MrJSdev
MrJSdev / gist:907504694405c563b573c1f473f99af0
Created September 23, 2021 17:26
Fetch all WordPress authors list
<?php
wp_list_authors( array(
'show_fullname' => 1,
'optioncount' => 1,
'orderby' => 'post_count',
'order' => 'DESC',
'number' => 3
) );
@MrJSdev
MrJSdev / index.php
Last active April 22, 2018 17:49
This is the code for the guide to display PHP errors: http://extracatchy.net/display-php-errors-warnings/
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<form role="search" method="get" class="search-form" id="searchform" action="<?php echo home_url( '/' ); ?>">
<div class="input-group">
<input type="search" id="s" class="form-control search-field"
placeholder="<?php echo esc_attr_x( 'Search…', 'placeholder' ) ?>"
value="<?php echo get_search_query() ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
<div class="input-group-append">
<span class="input-group-text"><button type="submit" class="search-button"><i class="fa fa-search"></i></button></span>
</div>
@MrJSdev
MrJSdev / form.php
Created April 19, 2018 05:26
This is the code snippets to fix undefined index error: http://extracatchy.net/undefined-index-error-php/
<?php
if(isset($_POST['field-name'])){
/* Do something */
}
@MrJSdev
MrJSdev / fees.php
Created April 16, 2018 17:48
This is the code for the guide: http://extracatchy.net/converting-string-to-date/ also check my lyrics website: http://lyroo.net
<?php
$newdate = DateTime::createFromFormat('d-m-Y', '16-04-2018')->format('Y-m-d');
?>
@MrJSdev
MrJSdev / functions.php
Created April 16, 2018 17:45
This is the code for the guide: http://extracatchy.net/converting-string-to-date/ also check my lyrics website: http://lyroo.net
<?php
$time = strtotime('16-04-2018');
$converted_date = date('Y-m-d', $time);
echo $converted_date;
?>
<?php
//Do not copy the above php tag.
function ec_custom_post_navigation()
{
?>
<div class="prev_next">
<div class="nav_left">
<span class="prev">Previous Post</span> <?php previous_post_link('%link', '%title'); ?>
</div class="nav_right">
@MrJSdev
MrJSdev / config.php
Last active September 25, 2021 11:39
This is the code to increase WordPress memory limit. http://extracatchy.net/wordpress-functions
<?php
//Do not copy the above php tag.
define('WP_MEMORY_LIMIT', '256M');
@MrJSdev
MrJSdev / functions.php
Last active April 2, 2018 05:42
This is the code for the guide to Increase WordPress Memory Limit: http://extracatchy.net/increase-memory-limit/
<?php
//Do not copy the above php tag.
define('WP_MEMORY_LIMIT', '256M');
@MrJSdev
MrJSdev / single.php
Created March 27, 2018 05:26
This is the code for the tutorial: http://extracatchy.net/if-post-id/
<?php
// Do not copy the above php tag.
global $post;
if( is_object( $post ) && 1780 == $post->ID ) {
/* ... */
}