This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const filePath = 'file path name'; | |
const files = fs.readdirSync(filePath).filter((file) => file.endsWith('.png')); | |
let count = 1; | |
const extName = '.png'; | |
files.forEach((file) => { | |
const oldPath = path.join(filePath, file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$blog_args = array( | |
'p' => get_the_ID(), | |
'post_type'=> 'post', | |
); | |
$mip_blogs = new WP_Query($blog_args); | |
$blog_arg = array( | |
'posts_per_page' => 20, | |
'post__not_in' => array(get_the_ID()), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$blog_args = array( | |
'p' => get_the_ID(), | |
'post_type'=> 'post', | |
); | |
$mip_blogs = new WP_Query($blog_args); | |
$blog_arg = array( | |
'posts_per_page' => 20, | |
'post__not_in' => array(get_the_ID()), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user. | |
* | |
* @since 0.6.0 | |
* @access public | |
*/ | |
class Breadcrumb_Trail { | |
/** | |
* Array of items belonging to the current breadcrumb trail. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update wordpress local to server data | |
====================================== | |
UPDATE wp_posts SET guid = replace(guid, 'localhostname','servername'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'localhostname', 'servername'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'localhostname','servername'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========== | |
custom url | |
<?php | |
$format = get_post_format(); | |
$category = get_the_category(); | |
$cats = array(); | |
foreach( $category as $cat ) { | |
$cats[] = $cat->term_id; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'prefix_get_meta' ) ) { | |
function prefix_get_meta( $data ) { | |
global $wp_embed; | |
$content = $wp_embed->autoembed( $data ); | |
$content = $wp_embed->run_shortcode( $content ); | |
$content = do_shortcode( $content ); | |
$content = wpautop( $content ); | |
return $content; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Author Porfile Widgets | |
===================== | |
php | |
==== | |
<?php | |
class prefix_Author_Widget extends WP_Widget | |
{ | |
public function __construct() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sakib_paginate_links(){ | |
global $wp_query; | |
$paginate_links = paginate_links( array( | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $wp_query->max_num_pages, | |
'type' => 'list', | |
) ); | |
} |
NewerOlder