This file contains hidden or 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
| FILE SPACING: | |
| # double space a file | |
| sed G | |
| # double space a file which already has blank lines in it. Output file | |
| # should contain no more than one blank line between lines of text. | |
| sed '/^$/d;G' |
This file contains hidden or 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 if ( get_field( 'schede_prodotti' ) ): ?> | |
| <table class="product-list simple-list"> | |
| <?php | |
| $ids = array(); // Empty array for the $post->IDs from the relationship fields | |
| $files = array(); // Empty array for the files from the repeater fields | |
| while( has_sub_field( 'schede_prodotti' ) ): | |
| /** |
This file contains hidden or 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 | |
| /** | |
| * Change text strings | |
| * | |
| * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
| */ | |
| function my_text_strings( $translated_text, $text, $domain ) { | |
| switch ( $translated_text ) { | |
| case 'Sale!' : | |
| $translated_text = __( 'Clearance!', 'woocommerce' ); |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <title>Superformula</title> | |
| <style> | |
| path { | |
| stroke-width: 1.5px; | |
| stroke: #666; | |
| fill: #ddd; | |
| } |
This file contains hidden or 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() { | |
| var root = this; | |
| var previousSuperformula = root.Superformula; | |
| var NP = 360, phi = Math.PI * 2 / NP; | |
| var Superformula = root.Superformula = function(m, n1, n2, n3) { |
This file contains hidden or 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 if ( is_home() ) : ?> | |
| <h2><?php echo the_title(); ?></h2> | |
| <?php elseif ( is_search() ): ?> | |
| <h1><?php | |
| $search_count = 0; | |
| $search = new WP_Query("s=$s&showposts=-1"); | |
| if($search->have_posts()) { | |
| while($search->have_posts()) { | |
| $search->the_post(); | |
| $search_count++; |
This file contains hidden or 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 | |
| /** | |
| * Save custom attachment meta | |
| * | |
| * @see wp_ajax_save_attachment_compat(), media_upload_form_handler(), edit_post() | |
| * | |
| * @param array $post The attachment attributes. | |
| * @param array $attachment_data An array of attachment fields. | |
| * | |
| * @return array The attachment attributes. |
This file contains hidden or 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 /* This code filters the Categories archive widget to include the post count inside the link */ | |
| add_filter('wp_list_categories', 'cat_count_span'); | |
| function cat_count_span($links) { | |
| $links = str_replace('</a> (', ' (', $links); | |
| $links = str_replace(')', ')</a>', $links); | |
| return $links; | |
| } | |
| /* This code filters the Archive widget to include the post count inside the link */ | |
| add_filter('get_archives_link', 'archive_count_span'); | |
| function archive_count_span($links) { |
This file contains hidden or 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 function sz_get_testimonials( $page_id ){ | |
| $testimonials = get_post_meta( $page_id, 'testimonial', false ); | |
| if ( $testimonials ) { | |
| $testimonial_list = "\n<ul>\n"; | |
| foreach ( $testimonials as $testimonial ) { | |
| $testimonial_image = false; | |
| $testimonial_content = false; | |
| $testimonial_list .= "\t<li class='row'>"; | |
| if ( $testimonial['testimonial-image'] ) { | |
| $testimonial_image = wp_get_attachment_image( $testimonial['testimonial-image'], 'full', '', array( 'class' => 'columns small-3' ) ); |
This file contains hidden or 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
| // join term_relationships and term_taxonomy | |
| add_filter( 'getarchives_join', 'customarchives_join' ); | |
| // add where condition for category | |
| add_filter( 'getarchives_where', 'customarchives_where' ); | |
| // add where condition for date | |
| add_filter('getarchives_where','filter_until_year_archives'); | |
| function customarchives_join($join_clause) { | |
| global $wpdb; | |
| return $join_clause." INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |