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 wpmark_alter_homepage_posts_query() | |
* Alter query on homepage for show just 5 posts | |
***************************************************************/ | |
function wpmark_alter_homepage_posts_query( $query ) { | |
/* check this is not the main query, the admin - if so bail early */ | |
if( ! $query->is_main_query() || is_admin() ) | |
return; |
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 will work in the loop | |
*******************************/ | |
/* check if the posts publish date is older than 60 days */ | |
if( strtotime( $post->post_date ) < strtotime('-60 days') ) { | |
/* post is older than 60 days - do something with it!! */ | |
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 wpmark_admin_menu_content() { | |
?> | |
<div class="wrap"> | |
<h2>My Admin Page</h2> | |
<?php |
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 wpptm_add_select_input( $settings ) { | |
/* add our setting to the settings array */ | |
$settings[] = array( | |
'type'=> 'select', | |
'label'=> 'A Select Box', | |
'id'=> ‘selectbox’, | |
'options' = array( | |
array( |