Skip to content

Instantly share code, notes, and snippets.

View genesis16's full-sized avatar

Jane James genesis16

View GitHub Profile
@genesis16
genesis16 / Bitbucketpipelines.yml
Created March 28, 2023 04:55
Bitbucketpipelines config php 7.4
image: php:7.4
pipelines:
branches:
master:
- step:
name: Deploy to Staging
deployment: staging
script:
- apt-get update
@genesis16
genesis16 / stickynav.js
Created March 2, 2023 01:28
Sticky nav
const stickyNav = document.querySelector('.site-header')
const header = document.getElementById('n2-ss-2')
const navHeight = document.querySelector('.site-header').getBoundingClientRect().height;
console.log(navHeight)
// Callback
const obsCallback = (entries, unobserver) => {
const [entry] = entries;
if (!entry.isIntersecting) stickyNav.classList.add("sticky-nav");
else stickyNav.classList.remove("sticky-nav");
@genesis16
genesis16 / changetitle.js
Created December 8, 2022 23:51
Change output and class of DOM element Jquery
jQuery(document).ready(function( $ ){
//$( ".qodef-ps-info-item.qodef-ps-categories" ).replaceWith( "<h6>PROJECT TYPE: General Practice </h6>" );
$( ".qodef-ps-info-item.qodef-ps-categories .qodef-ps-info-title" ).html( "<h6 class='title-project-type'>PROJECT TYPE:</h6>" );
$( ".qodef-ps-info-item.qodef-ps-categories a" ).wrap( "<span class='category-type-span'></span>" );
});
@genesis16
genesis16 / conditionalstaement.js
Created December 8, 2022 23:49
Change DOM element used in Multiple places
jQuery(document).ready(function( $ ){
var portfolio_title = $( ".qodef-ps-info-holder.qodef-ps-info-sticky-holder h3.qodef-ps-title" ).text();
if(portfolio_title == '100 years fitout'){
$( ".qodef-ps-info-holder.qodef-ps-info-sticky-holder h3.qodef-ps-title" ).html( "<h3 class='h3.qodef-ps-title'>DOCTORS OF SOUTH MELBOURNE</h3>");
}
@genesis16
genesis16 / addlogotoheader.js
Created December 8, 2022 23:20
Jquery add logo to center of header
jQuery(document).ready(function($){
var url = 'https://alphadevsite2.co/wp-content/uploads/2022/09/EH-Logo_Gradient.png';
$(document).ready(function() {
var img = new Image();
img.src = url;
$('li#nav-menu-item-6200').after("<li class='menu-logo20'><a href='https://alphadevsite2.co/' class='main-logo-link' style='width:auto;'></a></li>");
$('.main-logo-link').html(img);
});
@genesis16
genesis16 / header.php
Created September 18, 2022 05:28
Dessau header
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<?php
/**
* dessau_select_header_meta hook
*
* @see dessau_select_header_meta() - hooked with 10
* @see dessau_select_user_scalable_meta - hooked with 10
* @see dessau_core_set_open_graph_meta - hooked with 10
@genesis16
genesis16 / header.php
Created September 18, 2022 05:26
Bootstrap header
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<?php
/**
* dessau_select_header_meta hook
*
* @see dessau_select_header_meta() - hooked with 10
* @see dessau_select_user_scalable_meta - hooked with 10
* @see dessau_core_set_open_graph_meta - hooked with 10
@genesis16
genesis16 / related posts by type
Last active May 26, 2022 03:02
related custom post types
@genesis16
genesis16 / style.css
Created April 27, 2022 05:22
pagination
// go ahead and change the colours according to your brand
.pagination {
clear:both;
padding:20px 0;
position:relative;
font-size:11px;
line-height:13px;
}
// for practical purposes I have called this template archive-template
but if your custom post type category is moves you would call this archive-movies.php.
I have set the posts to 9, but you can set it to however many you want.
$paged = ( get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'insight',
'post_status' => 'publish',
'posts_per_page' => 9,