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 | |
// Add all your custom post type counts to 'Right Now' dashboard widget | |
function tanc_admin_post_types_rightnow(){ | |
$post_types = get_post_types(array('_builtin' => false), 'objects'); | |
if (count($post_types) > 0) | |
foreach ($post_types as $pt => $args) { | |
$url = 'edit.php?post_type=' . $pt; | |
echo '<tr><td class="b"><a href="' . $url . '">' . wp_count_posts($pt)->publish . '</a></td><td class="t"><a href="' . $url . '">' . $args->labels->name . '</a></td></tr>'; | |
} |
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 | |
/* | |
* On first publish set a special date in advance in custom field | |
*/ | |
add_action('transition_post_status','tanc_first_schedule_publish_set',10,3); | |
function tanc_first_schedule_publish_set($new, $old, $post) { | |
// REFERENCE | |
// $new = new post status ('publish') | |
// $old = old post status ('draft') |
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 | |
// Just a simple text string that appears near the footer as a HTML comment (view source) | |
function my_wfx_filter_code_credit() { | |
return 'Designed and coded by Wonderflux. Powered by WordPress and the Wonderflux theme framework.'; | |
} | |
add_filter( 'wflux_comment_code_credit', 'my_wfx_filter_code_credit' ); | |
// Replace the footer credit with your own text | |
function my_wfx_filter_footer_credit() { | |
return '<p class="meta">All content ©' . date('Y') . ' My Company | Website design & coding by <a href="http://www.wondeflux.com" class="footer-credit-logo" title="Website design and coding by Wonderflux">Wonderflux</a></p>'; |
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 | |
function mywfx_archive_order_by_title($query) { | |
if ( !is_admin() && $query->is_main_query() ) { | |
if ( is_post_type_archive( ‘kitty’ ) { | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} | |
return $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
<?php | |
/** | |
* Displays input in a nicer way for debugging | |
* Only displays for top level site admin by default | |
* Part of the Wonderflux theme framework | |
* | |
* @param string $input The content you wish to debug - a variable or function. | |
* @param string $admin_only Only display to top level site admin not other users. Default=true | |
* @param bool $role Only display to supplied WordPress role. Default = '' | |
* @param integer $id Only display to supplied user ID. Default = '' |
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 | |
$my_value = 5; | |
printf( _n( 'Counting just 1 time', 'Counting %s times, whoot!', $my_value, 'mytheme' ), $my_value ); | |
?> |
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 | |
/* | |
NOTE: Insert into template file as usual but use fallback_cb parameter - same name as function | |
wp_nav_menu( array( | |
'container_class' => 'primary-navigation clearfix', | |
'theme_location' => 'primary-nav', | |
'fallback_cb' => 'mywfx_empty_menu' | |
) ); | |
*/ |
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 | |
/** | |
* Remove crazy WordPress 4.2 Emoji junk | |
*/ | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
?> |
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 | |
/** | |
* BRIEF DESCRIPTION OF FUNCTIONALITY | |
* | |
* @package PACKAGE NAME | |
*/ | |
/* |
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
<h1>h1 title style</h1> | |
<h2>h2 title style</h2> | |
<h3>h3 title style</h3> | |
<h4>h4 title style</h4> | |
<h5>h5 title style</h5> | |
<h6>h6 title style</h6> | |
<h1>h1 title here, lets just check multi-line support and leading/spacing thanks to make sure we are good!h1 title here, lets just check multi-line support and leading/spacing thanks to make sure we are good!</h1> | |
Donec sed odio dui. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Vivamus sagittis lacu eu leo. Donec id elit non mi porta gravida at eget metus. Sed posuere consectetur est at lobortis. | |
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Cras mattis consectetur purus sit amet fermentum. Nullam id dolor id nibh ultricies vehicula. |
OlderNewer