Skip to content

Instantly share code, notes, and snippets.

View wisnust's full-sized avatar
🏠
Working from home

Wisnu Satrio T wisnust

🏠
Working from home
  • Indonesia
View GitHub Profile
@wisnust
wisnust / pagination.php
Created February 16, 2021 16:41 — forked from allenbell/pagination.php
Ajax pagination for posts linked via ACF Relationships
<?php
function ajax_pagination_enqueue() {
// Register and enqueue our javascript file
wp_register_script( 'pagination',
get_template_directory_uri() . '/library/js/pagination.js', // or wherever you put the file in your theme directory
array('jquery'));
wp_enqueue_script('pagination');
@hughc
hughc / gutenberg-audit.php
Created April 20, 2020 10:36
Gutenberg Audit for WordPress
<?php
/*
Plugin Name: Gutenberg Audit
Plugin URI: http://highbrow.com.au/plugins/gutenberg-audit
description: What blocks is your site using?
Version: 0.1
Author: Hugh Campbell
Author URI: http://highbrow.com.au/
License: GPL2
*/
<?php if( have_rows('collapse') ): ?>
<div id="accordion" role="tablist">
<?php $i=1; while ( have_rows('collapse') ) : the_row(); ?>
<div class="card">
<div class="card-header" role="tab" id="heading-<?php echo $i; ?>">
<h5 class="mb-0">
<a data-toggle="collapse" href="#collapse-<?php echo $i; ?>" aria-expanded="true" aria-controls="collapseOne">
<?php the_sub_field('title'); ?>
</a>
</h5>
@ndunk28
ndunk28 / slick-on-mobile.js
Last active March 10, 2022 18:31
slick js only on mobile
// slider
$slick_slider = $('.slider');
settings_slider = {
dots: false,
arrows: false
// more settings
}
slick_on_mobile( $slick_slider, settings_slider);
// slick on mobile
@allenbell
allenbell / pagination.css
Created February 10, 2016 20:15
Ajax pagination for posts linked via ACF Relationships - CSS
.bike-features {
margin-bottom: 15px;
}
#bike-features-container {
min-height: 400px;
}
#bike-features-inner, #bike-options-inner {
visibility: hidden;
@allenbell
allenbell / pagination.js
Created February 10, 2016 20:14
Ajax pagination for posts linked via ACF Relationships - JavaScript
jQuery(document).ready(function($){
$(document).on( 'click touchstart', '#pagination a', function( event ) {
// Fade out the old content for a smooth transition
$('#bike-features-inner').fadeOut();
// The pagination button you clicked will pass the page number back to the callback function
var page = $(this).attr('href');
@allenbell
allenbell / pagination.php
Created February 10, 2016 20:10
Ajax pagination for posts linked via ACF Relationships
<?php
function ajax_pagination_enqueue() {
// Register and enqueue our javascript file
wp_register_script( 'pagination',
get_template_directory_uri() . '/library/js/pagination.js', // or wherever you put the file in your theme directory
array('jquery'));
wp_enqueue_script('pagination');
@omurphy27
omurphy27 / Bootstrap Tabs used with Advanced Custom Fields ACF PHP JS HTML.php
Last active September 16, 2021 05:52
Bootstrap Tabs used with Advanced Custom Fields ACF PHP JS HTML
<?php if( have_rows('tabs') ): ?>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<?php $i=0; while ( have_rows('tabs') ) : the_row(); ?>
<?php
$string = sanitize_title( get_sub_field('tab_title') );
?>
<li role="presentation" <?php if ($i==0) { ?>class="active"<?php } ?> >
<a href="#<?php echo $string ?>" aria-controls="<?php echo $string ?>" role="tab" data-toggle="tab"><?php the_sub_field('tab_title'); ?></a>
</li>
<?php $i++; endwhile; ?>
@asilbalaban
asilbalaban / dummy.html
Created May 4, 2014 13:45
Wordpress Theme Dummy HTML Markup
<h1>This is the H1 Heading</h1>
<p>Above this paragraph should be the H1 heading for your web page. If it is not visible, the design settings for the H1 tag is set to <code>display:none</code> which many WordPress Themes use to hide the blog title text and replace it with a graphic. Do not use H1 within your blog post area.</p>
<p>If the design in the H1 heading looks like your blog title or blog post title, then that is the style set for that HTML tag and you should not use it within your blog post area.</p>
<p>Inside of this test data section are most of the basic HTML and XHTML and CSS styles that you might use within your WordPress Theme. You need to know what that will look like as part of structuring your styles.</p>
<h2>This is the H2 Heading</h2>
<p>Above this paragraph should be the H2 heading for your web page. WordPress Themes use the h2 heading for various purposes. Logically, it should be either the post title or the first heading in the post content.</p>
<p>However, it is used all over WordPres
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */