- Create a folder at the root of your user home folder
(Example:
C:/Users/uname/
) called.ssh
. - Create the following files if they do not already exist (paths begin from the root of your user home folder):
.ssh/config
-- Change Siteurl & Homeurl | |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl' | |
-- Change GUID | |
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') | |
-- Change URL in Content | |
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') | |
-- Change Image Path Only |
#!/bin/bash | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
<?php | |
function foundation_pagination($before = '', $after = '') { | |
global $wpdb, $wp_query; | |
$request = $wp_query->request; | |
$posts_per_page = intval(get_query_var('posts_per_page')); | |
$paged = intval(get_query_var('paged')); | |
$numposts = $wp_query->found_posts; | |
$max_page = $wp_query->max_num_pages; | |
if ( $numposts <= $posts_per_page ) { return; } | |
if(empty($paged) || $paged == 0) { |
<?php | |
class MyTheme | |
{ | |
private function actionAfterSetup($function) | |
{ | |
add_action('after_setup_theme', function() use ($function) { | |
$function(); | |
}); | |
} |
<?php | |
$args = array( | |
'label' => '', // Text in Label | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', | |
'value' => '', // if empty, retrieved from post meta where id is the meta_key | |
'id' => '', // required | |
'name' => '', //name will set from id if empty |
/* Vue 3 Render Function: https://v3.vuejs.org/guide/render-function */ | |
// Import utilities from Vue | |
import { h, resolveComponent } from "vue"; | |
import getLinkTag, { ANCHOR_TAG, FRAMEWORK_LINK } from "./getLinkTag"; | |
const SmartLink = { | |
props: { | |
href: { | |
type: String, | |
default: "" |
<?php | |
/** | |
* Sage includes | |
* | |
* The $sage_includes array determines the code library included in your theme. | |
* Add or remove files to the array as needed. Supports child theme overrides. | |
* | |
* Please note that missing files will produce a fatal error. | |
* | |
* @link https://github.com/roots/sage/pull/1042 |
<?php | |
// Add the field to the Add New Category page | |
add_action( 'category_add_form_fields', 'pt_taxonomy_add_new_meta_field', 10, 2 ); | |
function pt_taxonomy_add_new_meta_field() { | |
// this will add the custom meta field to the add new term page | |
?> | |
<div class="form-field"> | |
<label for="term_meta[cat_icon]"><?php _e( 'Font Awesome Icons', 'pt' ); ?></label> | |
<input type="text" name="term_meta[cat_icon]" id="term_meta[cat_icon]" value=""> |