Skip to content

Instantly share code, notes, and snippets.

@igorbenic
igorbenic / index.html
Created August 26, 2015 13:50
WebSocketi
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script >
//Ovdje ide kod
</script>
</head>
@igorbenic
igorbenic / ponav-meta1.php
Last active August 29, 2015 14:13
Ponavljajuća Polja za Metabox
<?php
/*
* Plugin Name: Ponavljajući Meta Field
* Plugin URI: www.lakotuts.com
* Description: Dodatak u koji dodaje ponavljajuće polje.
* Version: 1.0.0
* Author: Igor Benić
* Author URI: www.twitter.com/igorbenic
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@igorbenic
igorbenic / client.php
Last active August 29, 2015 14:24
Braintree Primjer
<?php
//Nekakva funkcija koja će nam dati product ID proizvoda kojeg se kupuje
//npr. WordPress Custom Post Type "product", u Loop-u se može koristiti get_the_id();
$productID = get_productID();
//Dohvaćamo library od Braintree-a
require_once "putanja/do/braintree/Braintree.php";
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('tvoj_id');
Braintree_Configuration::publicKey('tvoj_public_key');
@igorbenic
igorbenic / embed.html
Last active August 29, 2015 14:24
html5_2
<embed src="myFlashFile.swf" >
<a href="/go/getflashplayer/">
<img src=http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif alt="Get Adobe Flash player" />
</a>
</embed>
@igorbenic
igorbenic / index.html
Created October 5, 2015 08:28
HTML5 File API demo
<!doctype HTML5>
<html>
<head>
<title>Demo</title>
<script>
//Skripta ide ovdje
</script>
<style>
/*CSS ide ovdje*/
</style>
@igorbenic
igorbenic / error.js
Last active November 3, 2015 13:00
Geo Pozicioniranje u HTML-u
function pokaziGresku(greska) {
switch (greska.code) {
case greska.PERMISSION_DENIED:
prikaziPoruku("Korisnik nije dopustio dohvat Geolokacije.");
break;
case greska.POSITION_UNAVAILABLE:
prikaziPoruku("Informacije lokacije nije dostupna.");
break;
case greska.TIMEOUT:
prikaziPoruku("Zahtjev za dohvaćanje lokacije korisnike je istekao.");
@igorbenic
igorbenic / get_the_term_list.php
Last active January 5, 2016 10:39
Display the Terms of a Custom WordPress Taxonomy |
<?php get_the_term_list( $id, $taxonomy, $before, $sep, $after ) ?>
@igorbenic
igorbenic / content.php
Last active January 8, 2016 09:19
How to create WordPress Related Posts | Article on www.ibenic.com
<?php
add_filter( 'the_content','ibenic_related_content' );
function ibenic_related_content( $content ){
// Check if the content is of a single article
if( is_singular( 'post' ) ) {
global $post;
// Variable that will be used to create the HTML of related content
$related_content = "";
<?php
function ibenic_buddypress_tab() {
global $bp;
bp_core_new_nav_item( array(
'name' => __( 'My recent Posts', 'ibenic' ),
'slug' => 'recent-posts',
'position' => 100,
'screen_function' => 'ibenic_budypress_recent_posts',
@igorbenic
igorbenic / content.php
Last active March 31, 2016 21:31
How to Create Sharing Buttons similar to Jetpack | http://www.ibenic.com/create-sharing-buttons-similar-jetpack/
<?php
function my_share_render_in_content( $content ) {
ob_start();
?>
<ul id="my_share" class="my_share">
<li>
<a href="<?php the_permalink();?>?my_share=facebook">Facebook</a>
</li>
<li>