Skip to content

Instantly share code, notes, and snippets.

View rodica-andronache's full-sized avatar
🦄

Rodica-Elena Irodiu rodica-andronache

🦄
  • themeisle.com
  • Bucharest
View GitHub Profile
@rodica-andronache
rodica-andronache / gist:8419b5bad0ae2f46404c
Created August 1, 2014 19:22
Impiedica accesul la un fisier
defined('ABSPATH') or die("No script kiddies please!");
@rodica-andronache
rodica-andronache / gist:0016b412cebb3184f2de
Last active August 29, 2015 14:04
Traduceri Wordpress
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
La traduceri pentru PLUGINURI,
trebuie neaparat sa pun acelasi nume la domeniul din
load_plugin_textdomain('cwppos', false, dirname(plugin_basename(__FILE__)).'/languages/');
si in languages:
<div class="free-shiping"><p>FREE SHIPPING ON ALL ORDERS OVER £150</p></div>
.free-shiping {
display: table;
overflow: hidden;
}
p {
display: table-cell;
vertical-align: middle;
@rodica-andronache
rodica-andronache / gist:a3d99aa21a2204f03e82
Created June 13, 2014 11:09
Generare custom page template din plugin
class PageTemplater {
/**
* A Unique Identifier
*/
protected $plugin_slug;
/**
* A reference to an instance of this class.
*/
@rodica-andronache
rodica-andronache / gist:67ae2e2eafba3a608cc8
Created May 29, 2014 10:13
Centrare meniu (cu latime care nu este fixa)
http://matthewjamestaylor.com/blog/beautiful-css-centered-menus-no-hacks-full-cross-browser-support
<div id="centeredmenu">
<ul>
<li><a href="#">Tab one</a></li>
<li><a href="#" class="active">Tab two</a></li>
<li><a href="#">Tab three</a></li>
<li><a href="#">Tab four</a></li>
</ul>
</div>
@rodica-andronache
rodica-andronache / gist:c1a37dbb014277102c2d
Created May 29, 2014 08:44
Click pe elemente generate dinamic
jQuery(document).delegate('#addProgramare', 'click', function() {
console.log('a');
});
@rodica-andronache
rodica-andronache / gist:b84bee82b1ab8ab415c9
Last active July 6, 2016 10:03
widget cu text si imagine
add_action('widgets_init', 'zerif_ourfocus_widget');
function zerif_ourfocus_widget() {
register_widget( 'zerif_ourfocus' );
}
add_action('admin_enqueue_scripts', 'zerif_ourfocus_widget_scripts');
function zerif_ourfocus_widget_scripts() {
wp_enqueue_media();
wp_enqueue_script('zerif_our_focus_widget_script', get_template_directory_uri() . '/js/widget.js', false, '1.0', true);
}
wp_register_style( 'zerif_php_style', get_template_directory_uri() . '/css/style.php');
wp_enqueue_style( 'zerif_php_style' );
intr-un fisier style.php pe care il includ in functions:
<?php
include_once "../../../../wp-load.php";
header("Content-type: text/css");
@rodica-andronache
rodica-andronache / gist:162c6807f25e31d419e9
Created May 22, 2014 10:20
Install plugin automatically when install wordpress theme
Downloadez https://github.com/thomasgriffin/TGM-Plugin-Activation
In functions.php:
require_once get_template_directory() . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'zerif_register_required_plugins' );
function zerif_register_required_plugins() {
$plugins = array(
In ACF , selectez Taxonomy Term is equal to Categories.
Ca sa afisez in category.php:
$category_id = get_cat_id( single_cat_title("",false) );
$test = get_field( "test",'category' . '_' . $category_id );
if(isset($test) && $test != ""):
echo $test;
endif;