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:8e44d1dccadea02a978e
Last active August 29, 2015 14:01
Get category id on category.php
$category_id = get_cat_id( single_cat_title("",false) );
sau:
$category = get_the_category();
$category_id = $category[0]->cat_ID;
@rodica-andronache
rodica-andronache / gist:b4c46fc9d292107d9aee
Created May 5, 2014 15:17
Posts and custom post types in same category
La register_post_type trebuie adaugat :
'taxonomies' => array('category')
Ex:
add_action( 'init', 'trustedtherapist_create_post_type' );
function trustedtherapist_create_post_type() {
register_post_type( 'case',
array(
'labels' => array(
'name' => __( 'Cases' ),
@rodica-andronache
rodica-andronache / gist:10728639
Created April 15, 2014 12:31
Imagine cu opacitate
<div class="theme-pic">
<img src="http://cdn.themeisle.com/wp-content/uploads/edd/2014/04/cl_ss_01-289x150.jpg">
<div class="overlay"></div>
</div>
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
Traducere plugin:
In fisierul principal:
function a_testimonial_basics_plugin_setup () {
load_plugin_textdomain('TweetOldPost', false, 'tweet-old-post/languages');
}
add_action( 'plugins_loaded','a_testimonial_basics_plugin_setup');
Si fisiere .mo si .po din languages se numesc:
@rodica-andronache
rodica-andronache / gist:10017556
Last active August 29, 2015 13:58
EDD - Easy digital downloads
$th_price = edd_get_download_price(get_the_ID()); // pretul neformatat
Functii:
http://sunnyratilal.github.io/api-docs/
@rodica-andronache
rodica-andronache / gist:9601228
Created March 17, 2014 15:21
Centrare verticala imagine
<div class=frame>
<span class="helper"></span><img src="http://jsfiddle.net/img/logo.png" height=250 />
</div>
.helper {
display: inline-block;
height: 100%;
vertical-align: middle;
}
@rodica-andronache
rodica-andronache / Customizer
Last active August 29, 2015 13:57
Wordpress Customizer
!!!!!!!!!!!!!!!!!!!!!!
Valori default:
- trebuie sa pun si default la setting-ul respectiv
- cat si sa pun valoare default atunci cand iau valoarea cu get_theme_mod
$wp_customize->add_setting( 'ti_frontpage_boxthree_content',
array(
@rodica-andronache
rodica-andronache / gist:8790696
Created February 3, 2014 19:31
Change default error message "Please fill out the field"
jQuery(function() {
var intputElements = document.getElementsByTagName("INPUT");
for (var i = 0; i < intputElements.length; i++) {
intputElements[i].oninvalid = function (e) {
e.target.setCustomValidity("");
if (!e.target.validity.valid) {
if (e.target.name == "my-email") {
e.target.setCustomValidity("Va rugam completati adresa de email!");
}
else if(e.target.name == "my-password") {
http://jquery.malsup.com/cycle/
@rodica-andronache
rodica-andronache / gist:8453859
Created January 16, 2014 12:07
Operatii de citire/scriere fisiere/pagini in Wordpress
Daca folosesc functii php precum file_get_contents() o sa am erori in Theme Check.
Pt a le rezolva, trebuie folosit WP_Filesystem.Aceste metode sunt in general folosite pt partea de admin.
Pt a le folosi, in alta parte, nu in admin:
require_once(ABSPATH . 'wp-admin/includes/file.php');
WP_Filesystem();
global $wp_filesystem;