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 | |
if(have_posts()){ | |
while ( have_posts() ) : the_post(); | |
the_title(); | |
endwhile; | |
} | |
previous_posts_link(); | |
next_posts_link(); |
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
SELECT * from table1 as t1 LEFT JOIN table2 as t2 ON t2.foreign_key = t1.prmary_key WHERE t1.column_name LIKE '%{variable}%' |
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_filter( 'bp_core_sent_user_validation_email', 'custom_buddypress_activation_message', 1, 4 ); | |
function custom_buddypress_activation_message( $subject, $message, $user_id, $meta ) { | |
$user_meta = get_user_meta($user_id, 'activation_key', OBJECT); | |
$subject = '[SIEBA] Activate Users'; | |
$message .= 'Activate User With'; | |
$message .= 'Username: '.$_POST['signup_username'].'<br>'; | |
$message .= 'Email: '.$_POST['signup_email'].'<br>'; |
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 | |
/* Registration form _shrtcode*/ | |
function registration_form( $atts ) { | |
if ( !is_user_logged_in()) { | |
ob_start(); | |
?> | |
<div class="col"> | |
<h2>Registration Form</h2> |
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 profile_nav_item() { | |
global $bp; | |
bp_core_new_subnav_item( | |
array( | |
'name' => __( 'User Profile', 'buddypress' ), | |
'slug' => 'user-profile', | |
'position' => 10, | |
'screen_function' => 'user_listingsdisplay', |
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 my_widget() { | |
register_widget('Widget_Name'); | |
} | |
add_action('widgets_init', 'my_widget'); | |
/** |
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
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
wp.media.controller.Library.prototype.defaults.contentUserSetting=false; | |
}); | |
</script> |
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
#optional part to install wordpress coding standards | |
git clone https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs | |
# tell phpcs about the wordpress coding standards | |
cd ~/bin/phpcs | |
scripts/phpcs --config-set installed_paths ../wpcs | |
# we probably want to ignore the space indenting on the files | |
vim ~/bin/ruleset.xml |
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 custom_breadcrumbs() { | |
// Settings | |
$separator = '>'; | |
$breadcrums_id = 'breadcrumbs'; | |
$breadcrums_class = 'breadcrumbs'; | |
$home_title = 'Home'; | |
// If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat) |
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_action( 'edit_form_after_title', 'cpm_add_subtitle_field'); | |
function cpm_add_subtitle_field() { | |
global $post; | |
echo '<input type="hidden" name="wp_noncename" id="wp_noncename" value="' . wp_create_nonce( 'wp-subtitle' ) . '" />'; | |
echo '<div id="subtitlediv" class="top">'; | |
echo '<div id="subtitlewrap">'; | |
echo '<input type="text" id="cpmsubtitle" name="cpm_subtitle" value="' . esc_attr( get_post_meta( $post->ID, 'sub_title_meta', true ) ) . '" autocomplete="off" placeholder="' . esc_attr( __( 'Enter subtitle here' ) ) . '" />'; | |
echo '</div></div>'; | |
} |
OlderNewer