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 | |
// 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 | |
/* | |
* 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 | |
// 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>'; | |
} |
NewerOlder