Skip to content

Instantly share code, notes, and snippets.

// Naturally, this is relative to each theme,
// you're going to have to hunt to figure out
// what the items are called in your functions.php
// of parent theme or framework code
// theme prefix = most likely your theme folder name
// Read these threads for context...
// http://wordpress.org/support/topic/overriding-twentyeleven-theme-optionsphp
// http://stackoverflow.com/questions/8994887/how-to-remove-wordpress-theme-options-from-child-theme
// http://codex.wordpress.org/Function_Reference/remove_submenu_page
//How to edit a user profile on the front end?
//http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end
//Forcing nickname as display_name in custom edit profile template
//http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template
///////
<?php
@fritids
fritids / Create page upon theme activation in WordPress
Created February 8, 2014 13:50
Create page upon theme activation in WordPress
<?php
if (isset($_GET['activated']) && is_admin()){
$new_page_title = 'This is the page title';
$new_page_content = 'This is the page content';
$new_page_template = ''; //ex. template-custom.php. Leave blank if you don't want a custom page template.
//don't change the code bellow, unless you know what you're doing
$page_check = get_page_by_title($new_page_title);
$new_page = array(
'post_type' => 'page',
'post_title' => $new_page_title,
@fritids
fritids / avat&ars links
Last active November 3, 2015 07:49
just links
<?php //if (!$gender) : ?>
<div class="form-group">
<label class="control-label " ><b><?php _e('Choisissez votre sexe *', 'inkness');?></b></label>
<div class="radio radio-inline">
<input id="male" name="gender" type="radio" value="male" <?php if ( $_POST ['gender']=='male') echo 'checked="checked"';print $_POST['gender'] ; ?> >
<label for="male" class=" fg-color-black"><?php _e('Je suis&nbsp;<strong style="background-colorx: #9AC410; color;#fff; padding:5px;margin-left:4px;"> <i class="fa fa-male fa-lg"></i> &nbsp; un Homme </strong> &nbsp;', 'inkness'); ?></label>
</div>
<div class="radio radio-inline">
<input id="female" name="gender" type="radio" value="female" <?php if ( $_POST ['gender']=='female') echo 'checked="checked"';print $_POST['gender'] ; ?>>
<label for="female" class=" fg-color-black"><?php _e('Je suis&nbsp;<strong style="background-colorx: #9AC410;
@fritids
fritids / Bootstrap_nogradients
Created February 6, 2014 00:19
Elegant Way to Make Twitter Bootstrap Flat
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
}
$(function() {
// create a <div> to hold the overlay styles ...
$("body").append("<div id='overlay'></div>");
// get the height of the document ...
var docHeight = $(document).height();
// add some styling to the overlay.
$("#overlay")
@fritids
fritids / gist:8784332
Last active August 29, 2015 13:55
links
http://wordpress.org/support/topic/plugin-register-plus-password-always-too-short
http://wordpress.org/support/topic/wp-password-strength-meter
<?php
add_filter( 'smilies_src', 'cor_smilies_src', 1, 10 );
/**
* Smilies
*
* @param unknown_type $img_src
* @param unknown_type $img
* @param unknown_type $siteurl
* @return string
*/
<?php
add_filter( 'gettext', 'een_excerpt_meta', 10, 2 );
/**
* Rename the excerpt label and description.
*
* @since 0.1.0
*
* @param type $translation
* @param type $original
*