PHP Delete Cookie
<?php
// set the expiration date to one hour ago
setcookie("user", "", time() - 3600);
?>
<?php
echo "Cookie 'user' is deleted.";
?>
<?php
// set the expiration date to one hour ago
setcookie("user", "", time() - 3600);
?>
<?php
echo "Cookie 'user' is deleted.";
?>
<?php
$cookie_name = "user";
$cookie_value = "Alex Porter";
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/");
?>
<?php
if(!isset($_COOKIE[$cookie_name])) {
echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
echo "Cookie '" . $cookie_name . "' is set!<br>";
echo "Value is: " . $_COOKIE[$cookie_name];
}
?>
// Custom Post 1
register_post_type( 'courses',
array(
'labels' => array(
'name' => __( 'Courses' ),
'singular_name' => __( 'Course' )
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail'),
'show_ui' => true
)
);
register_taxonomy('courses_categories', 'courses', ['label' => 'Courses Categories','hierarchical' => true]);
NB! (The hierarchical array item is Important)
,’hierarchical’ => true
<?php echo do_shortcode("[shortcode]"); ?>
Inside your themes functions.php add the below snippet and fill out the placeholders.
############################################################################
//////////////////////////////////////
// This is your shortcode. You reference it like you see below with the square brackets.
// [shortcode_name_here]
//////////////////////////////////////
function echo_shortcode_function_name(){
ob_start();
include '/path to our file';
return ob_get_clean();
}
add_shortcode( 'shortcode_name_here', 'echo_shortcode_function_name');
############################################################################
Now reference your shortcode and it should load no issues if your file references are correct.