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 | |
// In folderul themes creati un folder inc daca nu-l aveti deja. | |
// In acest folder creati un fisier customizer.php | |
// ( el poate sa fie salvat si sub alt nume, eu doar am pus acest nume pentru ca e sugestiv). | |
// In interiorul acestui fisier (customizer.php) copy paste la functia prefix_customizer_register. | |
// prefix_ ar trebui inlocuit cu numele theme-ului vostru. Ex: bogdan_customizer_register | |
// La fel si textdomain-ul. | |
function prefix_customizer_register( $wp_customize ) { |
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 | |
// Query arguments : https://codex.wordpress.org/Class_Reference/WP_Query | |
$args = array( | |
'posts_per_page'=> 5, | |
'orderby' => 'date', | |
'order' => 'DESC', | |
'category' => 'slider' | |
); | |
// create the query |
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 rbpixel_customize_wc_errors( $error ) { | |
if ( strpos( $error, 'Billing ' ) !== false ) { | |
$error = str_replace("Billing ", "", $error); | |
} | |
return $error; | |
} | |
add_filter( 'woocommerce_add_error', 'rbpixel_customize_wc_errors' ); |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
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 the image node to RSS feed | |
add_action('rss2_item', 'add_featured_image_as_rss_node'); | |
function add_featured_image_as_rss_node() { | |
global $post; | |
if(has_post_thumbnail($post->ID)): | |
$thumbnail = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); | |
echo("<image>{$thumbnail}</image>"); | |
endif; | |
} |
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 | |
/** | |
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended | |
* to the end of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
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
# BLOCK PROXY VISITS | |
# PerishablePress.com: http://bit.ly/12k6Uo | |
<ifModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP:VIA} !^$ [OR] | |
RewriteCond %{HTTP:FORWARDED} !^$ [OR] | |
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR] | |
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR] | |
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR] | |
RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR] |
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 new rewrite rule | |
*/ | |
function create_new_url_querystring() { | |
add_rewrite_rule( | |
'blog/([^/]*)$', | |
'index.php?name=$matches[1]', | |
'top' | |
); | |
add_rewrite_tag('%blog%','([^/]*)'); |
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
$user_name = 'username'; | |
$user_email = 'email'; | |
$random_password = wp_generate_password( $length=12, $include_standard_special_chars=false ); | |
$user_id = username_exists( $user_name ); | |
if ( !$user_id and email_exists($user_email) == false ) { | |
$user_id = wp_create_user( $user_name, $random_password, $user_email ); | |
$user = get_user_by( 'id', $user_id ); | |
// Remove role | |
$user->remove_role( 'subscriber' ); |
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
/* | |
* this code goes in your theme`s functions.php file | |
*/ | |
add_filter('login_errors',create_function('$a', "return null;")); | |
define( 'DISALLOW_FILE_EDIT', true ); | |
function no_wordpress_errors(){ | |
return 'Nothing to see here, move along!'; | |
} |
NewerOlder