Skip to content

Instantly share code, notes, and snippets.

View brankoconjic's full-sized avatar

Branko Conjic brankoconjic

View GitHub Profile
@brankoconjic
brankoconjic / featured-image-caption.php
Created September 5, 2020 14:26
Highend Theme - Featured image with custom CAPTION attribute.
@brankoconjic
brankoconjic / custom-functions.php
Last active September 5, 2020 11:09
Highend Theme - Featured image with custom ALT attribute.
function highend_featured_image_thumb( $args = array() ) {
$args = wp_parse_args(
$args,
array(
'post_id' => '',
'width' => false,
'height' => false,
'crop' => false,
'alt' => '',
@brankoconjic
brankoconjic / sinatra-sticky-header.css
Last active June 23, 2020 16:09
Sticky header CSS for Sinatra theme.
/*****************************************/
/* Sticky Header CSS
/*****************************************/
.si-sticky-header #sinatra-header-inner {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 999;
@brankoconjic
brankoconjic / sinatra-sticky-header.js
Last active June 23, 2020 16:11
Adds sticky header functionality to Sinatra theme.
/*****************************************/
/* Sticky Header JS
/*****************************************/
( function() {
var sinatraStickyHeader = () => {
var header = document.getElementById('sinatra-header');
var headerInner = document.getElementById('sinatra-header-inner');
var wpadminbar = document.getElementById('wpadminbar');
var stickyPosition = header.getBoundingClientRect().top;
<?php
if ( ! defined( 'ABSPATH' ) ) { die( 'Direct access forbidden.' ); }
if ( ! class_exists( 'WP_Upgrader' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
}
if ( ! function_exists( 'request_filesystem_credentials' ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php' ;
}
@brankoconjic
brankoconjic / post-related-articles.php
Last active February 7, 2021 15:23
HighendWP - comments and likes count in post related articles.
<?php
/**
* @package WordPress
* @subpackage Highend
*/
$tags = wp_get_post_tags(get_the_ID());
if ( !$tags ) return;
$related_tags = array();
foreach ($tags as $tag) {
@brankoconjic
brankoconjic / class-metabox.php
Created November 12, 2019 19:52
The modified file for Highend 3.6.2: HighendWP » admin » metabox » class-metabox.php
<?php
/**
* Metabox Class.
*
* @package Highend
* @since 3.5.0
*/
if ( ! class_exists( 'Highend_Metaboxes' ) ) :