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
<?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; |
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
<?php | |
/** | |
* register product post type and taxonomy | |
*/ | |
function hip_med_register_product() | |
{ | |
register_post_type('product', [ | |
'labels' => [ | |
'name'=> __('Products','hip'), | |
'singular_name'=>__('Product','hip'), |
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
<?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 ) { |
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
/**add active classs in slider first item**/ | |
$(".carousel .carousel-item").first().addClass("active"); |
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
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; |
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 checkPalindrome($inputString) { | |
echo $inputString[0] == $inputString[(strlen($inputString) - 1)] ? 'Its palindrom' : 'Its not'; | |
} | |
checkPalindrome(abbab); | |
second way: | |
function checkPalindrome($inputString) { | |
$str = $inputString; | |
$rev = 0; |
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
/**scrol down nav**/ | |
$(window).scroll(function() { | |
if ($(this).scrollTop() >= 200) { | |
$('.header').addClass('stickytop'); | |
} | |
else { | |
$('.header').removeClass('stickytop'); | |
} | |
}); |
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
$('a[href*=#]').on('click', function(e) { | |
e.preventDefault(); | |
$('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top}, 500, 'linear'); | |
}); |
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
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 |
NewerOlder