Skip to content

Instantly share code, notes, and snippets.

View captprice26's full-sized avatar

captprice26

View GitHub Profile
function influex_elm_cnd_get_post_types() {
$post_types = get_post_types( array(
'public' => true,
'publicly_queryable' => true,
));
return $post_types;
}
add_action( 'elementor/theme/register_conditions', function( $conditions_manager ) {
jQuery(function($){
$(document).ready(function() {
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace("/",'') == this.pathname.replace("/",'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
// Horse Slider
function custom_shortcode() {
ob_start();
$args = array(
'post_type' => 'product',
'meta_key' => '_featured',
'meta_value' => 'yes',
'posts' => -1
);
@captprice26
captprice26 / notes.txt
Last active June 1, 2021 07:00
Build a Countdown Timer using javascript
AVAILABLE Time Formats
The ISO 8601 format: var deadline = '2015-12-31';
The short format: var deadline = '31/12/2015';
Or, the long format: var deadline = 'December 31 2015';
Each of these formats allows you to specify an exact time (in hours minutes and seconds), as well as a time zone (or an offset from UTC in the case of ISO dates).
For example: var deadline = 'December 31 2015 23:59:59 GMT+0200';
@captprice26
captprice26 / sharethis-shortcode.php
Created October 26, 2016 07:35
Wordpress - Sharethis Plugin Shortcode - functions.php
<?php
/**
* Creates sharethis shortcode
*/
if (function_exists('st_makeEntries')) :
add_shortcode('sharethis', 'st_makeEntries');
endif;
@captprice26
captprice26 / middle-header.php
Created October 26, 2016 06:09
For Wordpress - Genesis Theme Three division header (functions.php) *Note: DO NOT INCLUDE THE "<?php" tag
<?php
//Register in new Widget areas
function genesischild_extra_widgets() {
genesis_register_sidebar( array(
'id' => 'header-further-right',
'name' => __( 'Header Further Right', 'genesischild' ),
'description' => __( 'This is the Header Middle area', 'genesischild' ),
) );
}
@captprice26
captprice26 / secondary-header.php
Created October 26, 2016 06:06
For Wordpress - Genesis Theme secondary header (functions.php) *Note: DO NOT INCLUDE THE "<?php" tag
<?php
//* Secondary Top Header
genesis_register_sidebar( array(
'id' => 'utility-bar-left',
'name' => __( 'Utility Bar Left', 'theme-prefix' ),
'description' => __( 'This is the left utility bar above the header.', 'theme-prefix' ),
) );
genesis_register_sidebar( array(
@captprice26
captprice26 / genesis-custom-post-loop-pagination.php
Created October 26, 2016 06:01
For Wordpress - Genesis Theme Custom post loop with pagination
<?php
/* Template Name: Test */
/**
* Genesis custom loop
*/
function be_custom_loop() {
global $post;
// arguments, adjust as needed
$args = array(
'post_type' => 'post',
@captprice26
captprice26 / press-release.php
Last active October 26, 2016 06:31
Press Release plugin with shortcode and parameters "[press_release]" and "[press_release_list]" add these inside the shortcode to limit the custom post type "posts=your number"
<?php
/*
Plugin Name: Press Release (Custom Post Type)
*/
function my_custom_posttypes() {
$labels = array(
'name' => 'Press Releases',
'singular_name' => 'Press Release',
@captprice26
captprice26 / open-accordion-url.js
Created October 26, 2016 05:52
For Divi theme accordion open based on URL anchor
//Divi Theme Open Accordion based on Anchor Tag
jQuery(function($){
$(document).ready(function() {
var hashValue = location.hash;
hashValue = hashValue.replace(/^#/, ''); //Get the Hash value from URL
var newText = "#" + hashValue + " h5.et_pb_toggle_title"; //Concatenate the hash value to locate the toggle location
$(newText).click(); //Call the variable with hash and class in it
});
});