Skip to content

Instantly share code, notes, and snippets.

View joviczarko's full-sized avatar
🎯
Focusing

Jović Žarko joviczarko

🎯
Focusing
View GitHub Profile
Hash change of Bootstrap Tab
----------------------------
customized bootstrap tab component. here hash address will be changing on clicking on the tabs. and when ever copy this changed address to a browser url address accordingly it will show corresponding content in tabs
@joviczarko
joviczarko / function.php
Created November 19, 2020 00:11
Add countries as a custom taxonomy term
<?php
add_action('init', 'add_countries', 100);
function add_countries()
{
$country_array = array (
'AF' => 'Afghanistan',
'AX' => 'Åland Islands',
'AL' => 'Albania',
@joviczarko
joviczarko / style.scss
Created September 10, 2020 14:01
Ordered list number
.ordered-numbers-list {
list-style: none;
counter-reset: order-counter;
li {
counter-increment: order-counter;
margin-bottom: 30px;
display:flex;
&::before {
content: counter(order-counter);
font-weight: bold;
@joviczarko
joviczarko / style.css
Last active May 13, 2020 23:12
Equal height of bootstrap 4 columns
.row.equalize {
display: flex;
flex-wrap: wrap;
}
.row.equalize > [class*="col-"] {
display: flex;
flex-direction: column;
}
@joviczarko
joviczarko / style.scss
Last active April 25, 2020 17:38
Five columns Bootstrap grid (BOOTSTRAP v4!) (Adding five column layout for bootstrap)
// *** Bootstrap five columns *** //
.col-5th {
flex: 0 0 20%;
max-width: 20%;
}
@include r("tablet") {
.col-sm-5th {
flex: 0 0 20%;
@joviczarko
joviczarko / mixins.scss
Last active April 25, 2020 16:32
Responsive utility (tweaked)
// Media query mixins
@mixin r($point) {
@if $point== "mobile" {
@media (max-width: 767px) {
@content;
}
}
@if $point==768 or $point== "tablet" {
@media (min-width: 768px) {
@content;
@joviczarko
joviczarko / functions.php
Last active April 18, 2020 11:25
Wordpress numbered pagination
<?php
/**
* Set text domain
*/
function get_text_domain() {
return 'textdomain';
}
/**
@joviczarko
joviczarko / header.php
Created September 26, 2019 15:41
Display WPML language buttons custom with current language
<?php
$languages = icl_get_languages('skip_missing=0');
if(1 < count($languages)){
echo '<ul>';
foreach($languages as $l){
if(!$l['active']) {
$lang = '<li class="lang-button"><a href="'.$l['url'].'">'.$l['language_code'].'</a></li>';
} else {
$lang = '<li class="lang-button"><a class="current-lang" href="'.$l['url'].'">'.$l['language_code'].'</a></li>';
}
// Media query mixins
@mixin r( $point ) {
@if $point=='small' {
@media ( max-width: 576px ) {
@content;
}
}
@if $point==576 or $point=='mobile' {
@media ( min-width: 576px ) {
@content;
@joviczarko
joviczarko / url_upload.php
Last active May 14, 2022 15:54
Upload file from URL
<!DOCTYPE html>
<html>
<head>
<title>Upload file from URL</title>
<!-- From: https://stackoverflow.com/questions/22823204/is-there-any-way-to-upload-file-directly-from-url-in-filemanager-of-cpanel -->
</head>
<body>
<?php
$BASE_URL = strtok($_SERVER['REQUEST_URI'],'?');