View My Domain to Affiliate Link Redirect with WordPress
View HTML To Shortcode WordPress
function register_my_shortcode() {
ob_start(); ?>
<div class="my-shortcode">
<h1>Hi, I am the shortcode.</h1><hr />
<p>This is a screenshot of how I was created!</p>
<img src="https://d153h1xtzgec02.cloudfront.net/shortcode-function-blog-post.png" alt="Function Screen Shot">
<p>I was created by pasting &#x5b;shortcode_name] on this post!</p>
</div>
<?php
return ob_get_clean();
View Register Plugin
<?php
/*
Plugin Name: Name
Plugin URI: http://url.com
Description: Create amazing pluigns
Version: 1.
Author: Jerrick Hakim
Author URI: http://jhakim.com
*/
View WordPress Login URL Redirect
function jh_from_wp_login() {
$login_url = '/login';
wp_redirect( esc_url_raw( $login_url ) ); exit;
}
add_action( 'login_form_login', 'jh_from_wp_login' );
View Load Custom JS from Theme Folder
// LOAD CUSTOM JS
function load_custom_js() {
wp_enqueue_script( 'custom', get_stylesheet_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'load_custom_js' );
// LOAD CUSTOM STYLES
add_action( 'wp_enqueue_scripts', 'enqueue_load_fa' );
function enqueue_load_fa() {
View .htaccess 301 Redirect
Redirect 301 /landingurl https://newurl.com/
View Contact Form 7 Redirect on Submit
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( 'IDHERE' == event.detail.contactFormId ) {
location = 'http://yoururlhere.com';
}
}, false );
</script>
View 404 Redirect to Home URL
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>
View 404 Redirect to Custom URL
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".home_url('/replaceme'));
exit();
?>
View 404 Redirect to Complete URL
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://yoururlhere.com");
exit();
?>