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
// Display categories for Custom Post Types, add to functions.php | |
add_filter('pre_get_posts', 'query_post_type'); | |
function query_post_type($query) { | |
if(is_category() || is_tag()) { | |
$post_type = get_query_var('post_type'); | |
if($post_type) | |
$post_type = $post_type; | |
else | |
$post_type = array('post','news'); //substitute cpt - in this case 'news' - for post type |
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
// Display Custom Post Types on home page, add to functions.php | |
add_filter( 'pre_get_posts', 'my_get_posts' ); | |
function my_get_posts( $query ) { | |
if ( is_home() && $query->is_main_query() ) | |
$query->set( 'post_type', array( 'news' ) ); //add cpt, in this case 'news' to array | |
return $query; |
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
// make change to .gitignore | |
git rm --cached <filename> | |
// or, for all files | |
git rm -r --cached . | |
git add . | |
// then |
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
git config --global alias.<NAME> "<COMMAND>" |
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
git branch -D <branchName> | |
git push origin :<branchName> |
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
git rm -r --cached . | |
This removes everything from the index, then just run: | |
git add . | |
Commit it: | |
git commit -m ".gitignore is now working" |
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 | |
if ($_SERVER["HTTP_HOST"] == 'mydomain.com' || $_SERVER["HTTP_HOST"] == 'www.mydomain.com' ) { | |
// insert, for instance, analytics code here. | |
} |
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
# to remove already deleted files: | |
git add -u . | |
git commit -m "manually deleting files" |
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
Make sure you're using the SSH one: | |
ssh://[email protected]/username/repo.git. | |
And NOT the https or git one. | |
Fix the url in the .git/config file. |