This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://alexwright.net/blog/web-design/responsive-images-wordpress/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rows = get_field('sidebar_commercials', 'option' ); // get all the rows | |
// $rand_row = $rows[ array_rand( $rows ) ]; // get a random row | |
$row_count = count(get_field('sidebar_commercials', 'option')); // Count | |
if ($row_count >= 1) { | |
$first_baner = $rows[0]; | |
$baner_image_first = $first_baner['widget_commercial_image' ]; // get the sub field value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rows = get_field('sidebar_commercials', 'option' ); // get all the rows | |
// $rand_row = $rows[ array_rand( $rows ) ]; // get a random row | |
$row_count = count(get_field('sidebar_commercials', 'option')); // Count | |
if( $the_query->current_post === 2 ) { | |
if ($row_count >= 1) { | |
$first_baner = $rows[0]; | |
$baner_image_first = $first_baner['widget_commercial_image' ]; // get the sub field value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert SVG path to HTML x,y cordinate | |
// Length of path | |
var pathLength = Math.floor( this.getTotalLength() ); | |
prcnt = pathLength / 100; | |
// Get x and y values at a certain point in the line | |
pt = this.getPointAtLength(prcnt); | |
pt.x = Math.round(pt.x); | |
pt.y = Math.round(pt.y); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert SVG <rect> x,y cordinate to HTML cordinate | |
var svg = this; | |
var svg_el = document.getElementsByClassName(element_class); | |
var rootSVG = document.querySelector("#front-view svg"); | |
var point = rootSVG.createSVGPoint(); | |
var matrix, position; | |
matrix = svg_el[0].getCTM(); | |
point.x = svg.attr('x'); | |
point.y = svg.attr('y'); | |
position = point.matrixTransform(matrix); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_login_shortcode() { | |
if ( ! is_user_logged_in() ) { // Display WordPress login form: | |
$args = array( | |
'redirect' => home_url() . '/alumni/', | |
'form_id' => 'loginform-custom', | |
'label_username' => __( 'Korisničko ime ili Email' ), | |
'label_password' => __( 'Lozinka' ), | |
'label_remember' => __( 'Zapamti me' ), | |
'label_log_in' => __( 'Prijavi se' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- IMPORTANT!!! If you want to use OEmbed like this your Instagram profile MUST BE PUBLIC --> | |
<?php | |
// Using curl because if you use file_get_contents() it need more then 10s page to be loaded... | |
function curl_get_contents($url) { | |
// Initiate the curl session | |
$ch = curl_init(); | |
// Set the URL | |
curl_setopt($ch, CURLOPT_URL, $url); | |
// Removes the headers from the output | |
curl_setopt($ch, CURLOPT_HEADER, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Using curl because if you use file_get_contents() it need more then 10s page to be loaded... | |
function curl_get_contents($url) { | |
// Initiate the curl session | |
$ch = curl_init(); | |
// Set the URL | |
curl_setopt($ch, CURLOPT_URL, $url); | |
// Removes the headers from the output | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
// Return the output instead of displaying it directly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function objectToArray($d) { | |
if (is_object($d)) { | |
// Gets the properties of the given object | |
// with get_object_vars function | |
$d = get_object_vars($d); | |
} | |
if (is_array($d)) { | |
/* | |
* Return array converted to object |