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
add_image_size( 'zerif-testimonial', 73, 73, true ); | |
add_image_size( 'zerif-clients', 130, 50, true ); | |
add_filter('image_size_names_choose', 'zerif_image_sizes'); | |
function zerif_image_sizes($sizes) { | |
$zerif_addsizes = array( "zerif-our-focus" => __( "Our focus","zerif"), "zerif_our_team_photo" => __("Our team","zerif"), "zerif-testimonial" => __("Testimonial", "zerif"), "zerif-clients" => __("Client logo","zerif") ); | |
$zerif_newsizes = array_merge($sizes, $zerif_addsizes); | |
return $zerif_newsizes; |
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
add_image_size( 'zerif-our-focus-widget', 125, 125, true ); | |
global $wpdb; | |
$our_focus_attachment_id = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", esc_url($instance['image_uri']) )); /* attachement id by attachement url */ | |
$aa = wp_get_attachment_image_src( $attachment[0], 'zerif-our-focus-widget' ); | |
echo $aa[0]; /* url-ul imaginii */ | |
SAU varianta mai buna: |
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
http://wordpress.stackexchange.com/questions/26557/programmatically-add-widgets-to-sidebars | |
/** | |
* Super simple widget. | |
*/ | |
class T5_Demo_Widget extends WP_Widget | |
{ | |
public function __construct() | |
{ // id_base , visible name | |
parent::__construct( 't5_demo_widget', 'T5 Demo Widget' ); |
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
http://codex.wordpress.org/Create_A_Network |
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
add_action( 'init', 'zerif_create_post_type' ); | |
function zerif_create_post_type() { | |
/* portofolio */ | |
register_post_type( 'portofolio', |
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
class Color_Picker_Widget_25809 extends WP_Widget { | |
/** | |
* Widget constructor. | |
* | |
* @since 1.0 | |
* | |
* @access public | |
*/ | |
public function __construct() { |
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
http://speakinginbytes.com/2014/07/woocommerce-settings-tab/ | |
If you’re building a WooCommerce extension the easiest thing you can do to improve your UI is to put all WooCommerce settings where users can find them – on a new WooCommerce settings tab. | |
1 – Add a New WooCommerce Settings Tab | |
You just need to add one extra array item to the woocommerce_settings_tabs_array filter. | |
<?php | |
class WC_Settings_Tab_Demo { | |
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
http://wptheming.com/2011/08/admin-notices-in-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
http://www.paulund.co.uk/rewrite-urls-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
jQuery('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = jQuery(this.hash); | |
target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
jQuery('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; | |
} |