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 | |
| /** | |
| * Class to return multiple RSS feeds in WordPress | |
| * Instructions: | |
| * 1. Upload this class to theme folder | |
| * 2. Include this class in functions.php ie: include "mytheme/wow_rss.php"; | |
| * | |
| * In theme template: | |
| * 3. Create new object of class ie: $obj = new wow_Rss ("http://www.mywebsite.co.uk/feed","5"); | |
| * Enter feed url as 1st argument and how many items from that feed as the 2nd |
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 | |
| /** | |
| * generate featured image automatically | |
| * @author @david <david@davidvandenbor.nl> | |
| */ | |
| function autogen_featured_img() { | |
| global $post; | |
| if (!has_post_thumbnail($post->ID)) { | |
| $attached_image = |
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
| //reflow after page load | |
| $(document).foundation('accordion', 'reflow'); | |
| //animate open/close | |
| $(".accordion li").on("click", "a:eq(0)", function (event) { | |
| var dd_parent = $(this).parent(); | |
| if(dd_parent.hasClass('active')) { | |
| $(".accordion li ul.content:visible").slideToggle("normal"); | |
| } else { |
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
| UPDATE wp_options SET option_value = replace(option_value, 'http://www.alpha-audio.nl', 'http://www.alpha-audio.dev') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET guid = replace(guid, 'http://www.alpha-audio.nl','http://www.alpha-audio.dev'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'http://www.alpha-audio.nl', 'http://www.alpha-audio.dev'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.alpha-audio.nl','http://www.alpha-audio.dev'); |
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 alter_comment_form_fields($fields){ | |
| //$fields['author'] = ''; //removes name field | |
| //$fields['email'] = ''; //removes email field | |
| //$fields['url'] = ''; //removes website field | |
| return $fields; | |
| } | |
| add_filter('comment_form_default_fields','alter_comment_form_fields'); |
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
| <h1><?php //single_cat_title() ?></h1> | |
| <?php //echo str_replace('Categorie: ','',get_the_archive_title()); ?> | |
| <?php //echo '<h1 class="page-title">' . single_cat_title( '', false ) . '</h1>'; ?> |
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 | |
| add_filter( 'post_thumbnail_html', 'remove_width_attribute', 10 ); | |
| add_filter( 'image_send_to_editor', 'remove_width_attribute', 10 ); | |
| function remove_width_attribute( $html ) { | |
| $html = preg_replace( '/(width|height)="\d*"\s/', "", $html ); | |
| return $html; | |
| } | |
| ?> |
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 | |
| /** | |
| * -------------------------------------------------------------------------------// | |
| * wrap video's with Zurb Foundation flex-video class div | |
| * @author @david | |
| * -------------------------------------------------------------------------------// | |
| */ | |
| add_filter('embed_oembed_html', 'david_embed_oembed_html', 99, 4); | |
| function david_embed_oembed_html($html, $url, $attr, $post_id) { | |
| return '<div class="flex-video widescreen">' . $html . '</div>'; |
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
| .container { | |
| max-width: 640px; | |
| max-height: 640px; | |
| margin: 0 auto | |
| } | |
| .google_map | |
| { | |
| width: 100%; |
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
| // this is how you can insert pieces of HTML code into pages using jQuery | |
| var dynamic_html = "<div><span>Highlighted</span><span>Author</span></div>"; | |
| document.getElementByID("container").innerHTML = dynamic_html; |