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
//This code should be added in the plugin that manages the custom post type or in the functions.php of you theme | |
add_filter('request', 'hack_pagination');//Register the filter | |
/** | |
* Hack to give a custom posts_per_page value for a custom post type | |
* @param string $query_string automatically given by the filter | |
*/ | |
function hack_pagination($query_string){ | |
if($query_string['post_type']=='MY_CUSTOM_POST_TYPE' && !is_single() && !is_admin()) { |
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
//This filter will allow us to add new columns | |
add_filter("manage_edit-mycustom_columns", "edit_columns"); | |
//This action will populate the new columns | |
add_action("manage_posts_custom_column", "custom_columns"); | |
/** | |
* First step : declaring the new columns (in this function, we could also remove the default columns...) | |
* @param array $columns | |
*/ |
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
//WordPress Query to load custom posts using their custom fields | |
$myquery = new WP_Query(array( | |
'post_type' => 'mycustom', | |
'posts_per_page' => 15, | |
'orderby' => 'meta_value', | |
'meta_key'=>'mycustom_date_start', | |
'order' => 'ASC', | |
'meta_query'=>array( | |
'relation'=>'AND', | |
array( |
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
@first_team first_dev second_dev | |
@second_team third_dev fourth_dev | |
@first_repo_group one_repo second_repo | |
@second_repo_group third_repo fourth_repo | |
repo @first_repo_group | |
RW = @first_team | |
R = @second_team |
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
server: | |
#verbosity: 1 | |
#definition des interfaces réseaux du serveur | |
interface: 127.0.0.1 | |
interface: 192.168.0.20 | |
#ouverture à tout le monde | |
access-control: 0.0.0.0/0 allow | |
chroot: "" |
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
<VirtualHost *:80> | |
ServerName www.loicg.dev.com | |
ServerAlias *.*.dev.com | |
VirtualDocumentRoot /home/web/workspace/%2/%1 | |
<Directory /> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
</Directory> | |
</VirtualHost> |
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
diff -U 0 file1.csv file2.csv | grep '^-[^-]' | wc -l |
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
# Use case (mine) : | |
# You're deploying a new version of a website on client's hosting. | |
# Of course, the previous website is in the root directory... | |
# You want your v2/ directory to be visible only for you and the client | |
# And the client (and perhaps you) doesn't have a static IP... | |
# | |
# In this case, I've decided to use a cookie. | |
# But, how may I set a cookie in the clients browser ? | |
# What if she wants to browser thi shinny new website with her smartphone or tablet ??? | |
# What if she wants to show it to her team or even family ??? |
I hereby claim:
- I am chibani on github.
- I am chibani (https://keybase.io/chibani) on keybase.
- I have a public key whose fingerprint is 0FA5 1579 2BF6 456E 57E4 385C FD26 F7FA AEE0 C351
To claim this, I am signing this object:
OlderNewer