Skip to content

Instantly share code, notes, and snippets.

View nayonptk's full-sized avatar

Md. Nayon Hossain nayonptk

View GitHub Profile
$('.classname').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 2000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
//Main menu fixed
var nav = $('.rhealth-header-section-area');
$(window).scroll(function () {
if ($(this).scrollTop() > 80) {
nav.addClass("fixed");
} else {
nav.removeClass("fixed");
}
});
// Function
function cb_get_embedded_media( $type = array() ){
$content = do_shortcode( apply_filters( 'the_content', get_the_content() ) );
$embed = get_media_embedded_in_content( $content, $type );
if( in_array( 'audio' , $type) ):
$output = str_replace( '?visual=true', '?visual=false', $embed[0] );
else:
$output = $embed[0];
{ "keys": ["ctrl+shift+r"], "command": "reindent", "args": {"single_line":false}}
prefernces>key binding
@nayonptk
nayonptk / searchform.php
Created September 25, 2019 09:26 — forked from hmbashar/searchform.php
wordpress search form markup changes.
<!-- shapehost sidebar search -->
<div class="shapehost-sidebar-search">
<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" id="<?php echo $unique_id; ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search and type enter &hellip;', 'placeholder', 'shape' ); ?>" value="<?php echo get_search_query(); ?>" name="s" >
<button type="submit" class="search-submit"><i class="fa fa-search"></i></button>
</form>
</div>
<!-- shapehost sidebar search end-->
@nayonptk
nayonptk / Avada Theme scripts handler.php
Created September 25, 2019 09:26 — forked from hmbashar/Avada Theme scripts handler.php
To build on what Michael C wrote, and based on another post that I came across (https://theme-fusion.com/forums/topic/related-posts-not-showing-on-post-pages/), I was able to put together a solution to this using the Avada Child Theme. I found that disabling Fusion Builder Elements in the Fusion Builder settings did not consistently remove the d…
<?php
add_action( 'wp_enqueue_scripts', 'custom_disable_theme_js' );
function custom_disable_theme_js() {
Fusion_Dynamic_JS::deregister_script('avada-comments');
Fusion_Dynamic_JS::deregister_script('avada-general-footer');
Fusion_Dynamic_JS::deregister_script('avada-mobile-image-hover');
Fusion_Dynamic_JS::deregister_script('avada-quantity');
Fusion_Dynamic_JS::deregister_script('avada-scrollspy');
Fusion_Dynamic_JS::deregister_script('avada-select');
<?php
function shape_custom_post_taxonomy() {
register_taxonomy(
'testimonial_category', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
'shape-testimonial', //post type name
array(
'hierarchical' => true,
'label' => 'Categories', //Display name
'query_var' => true,
'show_admin_column' => true,
@nayonptk
nayonptk / Sticky Header.js
Created September 25, 2019 09:24 — forked from hmbashar/Sticky Header.js
sticky header secton or menu/ header section position fixed after scrolling
$(window).scroll(function() {
var windowSize = $(window).width();
var kotoDur = $(window).scrollTop();
var menurParHoisi = $(".header-section").scrollTop();
if (kotoDur > menurParHoisi && windowSize > 767) {
$('.header-section').addClass('header-position-fixed');
}else{
$('.header-section').removeClass('header-position-fixed');
@nayonptk
nayonptk / related-post.php
Created September 18, 2019 05:42 — forked from hmbashar/related-post.php
Query related post by category
<?php
$related = get_posts( array( 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 5, 'post__not_in' => array($post->ID) ) );
if( $related ) foreach( $related as $post ) {
setup_postdata($post); ?>
<ul>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php the_content('Read the rest of this entry &raquo;'); ?>
</li>
@nayonptk
nayonptk / changes title placeholder.php
Created September 15, 2019 18:58 — forked from hmbashar/changes title placeholder.php
How to change custom post title placeholder text
<?php
function social_change_title_text( $title ){
$screen = get_current_screen();
if ( 'movie' == $screen->post_type ) {
$title = 'Enter movie name with release year';
}