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
| //* Add widget area after the third post in archives | |
| add_action( 'genesis_after_entry', 'prefix_archive_widgets' ); | |
| function prefix_archive_widgets() { | |
| if ( !is_archive() ) return; | |
| global $wp_query; | |
| if ( 2 == $wp_query->current_post ) { | |
| genesis_widget_area( 'archive-content-ad', array( | |
| 'before' => '<div class="archive-ad archive-content-ad clearfix">', | |
| 'after' => '</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
| /** A custom shortcode to fetch terms of a custom taxomomy for any post **/ | |
| add_shortcode( 'prefix-custom-post-meta', 'prefix_custom_post_meta' ); | |
| function prefix_custom_post_meta( $atts ) { | |
| $defaults = array( | |
| 'prepend' => 'Listed Under: ', // Text to be added before the terms output. | |
| 'append' => '', // Text to be added after the terms ouptut. | |
| 'separator' => '· ', // Separator used to separate multiple terms. | |
| 'taxonomy' => '', // Taxonomy name to fetch the terms from. Replace to set a default. | |
| ); | |
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
| add_filter( 'pre_get_posts', 'prefix_cpk_show_cpt_archives' ); | |
| add_action( 'pre_get_posts', 'prefix_cpk_add_custom_post_types_to_loop' ); | |
| /** | |
| * prefix_cpk_show_cpt_archives - Display job posting entires on taxonomy archive pages | |
| * | |
| * @param [type] $query | |
| * @return void | |
| */ | |
| function prefix_cpk_show_cpt_archives( $query ) { | |
| if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { |
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
| /** | |
| * Add a little intro above the post editor screen for Job_post CPT. | |
| */ | |
| add_action( 'edit_form_after_title', 'prefix_add_editor_intro' ); | |
| function prefix_add_editor_intro() { | |
| global $post, $post_type; | |
| if( is_admin() && 'job_posting' == $post_type ) { | |
| echo 'Enter full job description in box below, including, but not limited to: education requirements, experience needed, recommended skills, job responsibilities, benefits, application requirements, salary, etc.'; | |
| } | |
| } |
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
| add_filter( 'ssp_episode_meta_details', 'ssp_remove_download_links', 10, 3 ); | |
| function ssp_remove_download_links ( $meta, $episode_id, $context ) { | |
| $agent=strtoupper($_SERVER['HTTP_USER_AGENT']); | |
| if ( strpos($agent,'MSIE') !== false || strpos($agent,'TRIDENT')!== false ) { | |
| // Someone is STILL using IE. Don't show the downlolad links since they won't work in SSP. | |
| /* IE specific code here */ | |
| return /*filtered result*/; | |
| } | |
| return $meta; | |
| } |
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
| SELECT `ID`, `post_title`, `post_type` | |
| FROM `wp_posts` | |
| WHERE `post_type` NOT IN ('post','page','attachment','revision','nav_menu_item','custom_css','customize_changeset') | |
| LIMIT 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
| <?php | |
| //Insert ads after second paragraph of single post content. | |
| add_filter( 'the_content', 'wsm_insert_post_ads' ); | |
| function wsm_insert_post_ads( $content ) { | |
| $ad_code = '<div class="content-ad-block"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
| <!-- Top Posts 300 250 --> | |
| <ins class="adsbygoogle" | |
| style="display:inline-block;width:300px;height:250px" | |
| data-ad-client="ca-pub-2169025261524250" |
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 | |
| /** | |
| * Ref: https://kuttler.eu/en/code/wordpress-emergency-admin/ | |
| * Upload to wp-content/mu-plugins/whichevernameyoulike.php | |
| */ | |
| $login = 'foobar'; # New username | |
| $password = 'barbaz'; # Password for the new user | |
| $email = 'you@example.com'; # Email address of the new user | |
| $ip = '127.0.0.1'; # Insert your IP, http://google.com/search?&q=what%20is%20my%20ip |
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
| add_filter( 'woocommerce_subcategory_count_html', '__return_null' ); |
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
| // Disabling gallery features | |
| // This new gallery is off by default for custom and 3rd party themes since it's common to disable the WooCommerce gallery | |
| // and replace with your own. To enable the gallery, you can declare support like this | |
| add_theme_support( 'wc-product-gallery-zoom' ); | |
| add_theme_support( 'wc-product-gallery-lightbox' ); | |
| add_theme_support( 'wc-product-gallery-slider' ); | |
| // You do not have to support all 3; you can pick and choose. | |
| // If a feature is not supported, the scripts will not be loaded and the gallery code will not execute on product pages. |