Skip to content

Instantly share code, notes, and snippets.

View masumskaib396's full-sized avatar

Masum Sakib masumskaib396

  • Dhaka,Bangladesh
View GitHub Profile
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);
$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()),
$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()),
/**
* 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.
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');
==========
custom url
<?php
$format = get_post_format();
$category = get_the_category();
$cats = array();
foreach( $category as $cat ) {
$cats[] = $cat->term_id;
}
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;
}
}
Author Porfile Widgets
=====================
php
====
<?php
class prefix_Author_Widget extends WP_Widget
{
public function __construct()
{
<?php
$paged = get_query_var('paged')? get_query_var('paged') : 1;
$acf_rel_id = get_field('relatied_post');
$post_par_page = 3;
$acf_rp = new WP_Query( array(
'post__in' => $acf_rel_id,
'orderby' => 'post__in',
'posts_per_page' => $post_par_page,
'paged' => $paged,