Skip to content

Instantly share code, notes, and snippets.

View ibrahimkholil's full-sized avatar
🎯
Focusing

Ibrahim khalil ibrahimkholil

🎯
Focusing
  • Orangetoolz
  • House 77 (9th Floor), Road 13, Sector 10, Uttara, Dhaka -1230
  • X @IKholil
View GitHub Profile
@ibrahimkholil
ibrahimkholil / wp_user_query_pagination.php
Created April 4, 2023 09:55 — forked from mujahidi/wp_user_query_pagination.php
Pagination with WP_User_Query object
<?php
// number of users we want to show per page
$number = 10;
// to pinpoint the current pagination number
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
// count the number of users that should be passed over in the pages (offset) – this will take effect at the second page onwards.
$offset = ($paged - 1) * $number;
@ibrahimkholil
ibrahimkholil / Submenu Dropdown Toggle
Created July 2, 2019 11:24
Submenu Dropdown Toggle
//Submenu Dropdown Toggle
if($('.nav-menu li.menu-item-has-children ul').length){
$('.nav-menu li.menu-item-has-children').append('<div class="dropdown-btn"><span class="fa fa-angle-down"></span></div>');
//Dropdown Button
$('.nav-menu li.menu-item-has-children .dropdown-btn').on('click', function() {
$(this).prev('ul').slideToggle(500);
});
//Disable dropdown parent link
@ibrahimkholil
ibrahimkholil / custom post type with metabox texanomy
Created December 12, 2018 06:52
custom post type with metabox texanomy
<?php
/**
* register product post type and taxonomy
*/
function hip_med_register_product()
{
register_post_type('product', [
'labels' => [
'name'=> __('Products','hip'),
'singular_name'=>__('Product','hip'),
<?php
/* Doctor META BOXES */
add_action( 'add_meta_boxes', 'brb_doctor_add_meta_box' );
add_action( 'save_post', 'brb_save_doctor_position_data' );
function brb_doctor_add_meta_box() {
add_meta_box( 'doctor_position', 'Doctor Position', 'brb_doctort_position_callback', 'doctor' );
}
function brb_doctort_position_callback( $post ) {
@ibrahimkholil
ibrahimkholil / Add Active class in slider current element
Created December 1, 2018 13:34
Add Active class in slider current element
/**add active classs in slider first item**/
$(".carousel .carousel-item").first().addClass("active");
@ibrahimkholil
ibrahimkholil / Post excerpt
Created October 23, 2018 09:59
Wp post excerpt
add_filter( 'the_excerpt', array($this,'new_excerpt_more'));
add_filter( 'excerpt_more', array($this,'realestate_excerpt_more'));
/*
*Excerpt with link
*
*
*/
public function new_excerpt_more($more) {
global $post;
@ibrahimkholil
ibrahimkholil / Palindrome number in php
Created October 13, 2018 11:50
Palindrome number in php
function checkPalindrome($inputString) {
echo $inputString[0] == $inputString[(strlen($inputString) - 1)] ? 'Its palindrom' : 'Its not';
}
checkPalindrome(abbab);
second way:
function checkPalindrome($inputString) {
$str = $inputString;
$rev = 0;
/**scrol down nav**/
$(window).scroll(function() {
if ($(this).scrollTop() >= 200) {
$('.header').addClass('stickytop');
}
else {
$('.header').removeClass('stickytop');
}
});
@ibrahimkholil
ibrahimkholil / Scroll Down js
Last active October 10, 2018 13:12
Scroll Down section scroll up
$('a[href*=#]').on('click', function(e) {
e.preventDefault();
$('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top}, 500, 'linear');
});
@ibrahimkholil
ibrahimkholil / wordpress meta key and values SQL Query
Created April 25, 2017 06:31
wordpress meta key and values SQL Query
hi guys,
I am stuck in finding the way of how to make such query that will find the data from meta_key and meta_values form wordpress post meta table related with posts.
Let me show u what I am trying to achieve:
go to this page
http://jollyhits.com/classiads/test-list/4
one field is category field and other fields are meta_key and values.
So, the SQL query that I am using is