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
// "Read More" text value without a filter. | |
$read_more_text = 'Continue reading...'; | |
// "Read More" text value a filter applied. | |
$read_more_text = apply_filters( 'theme_read_more_text', 'Continue reading...' ); |
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
add_action( 'theme_hook_before_content', 'my_custom_text' ); | |
/* | |
* Echo some text inside a function and then hook | |
* that function into a specified hook location | |
* using the add_action WordPress function. | |
*/ | |
function my_custom_text() { | |
echo 'Hello World!'; |
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
<!-- Example of a basic HTML structure and some action hook calls | |
to help show how action hooks are setup in specific locations, | |
ready to be hooked into with the add_action call. --> | |
<body> | |
<!-- Generally hooks that are created by the theme | |
start with their theme name at the beginning of | |
the hook name, in this generic case "theme_". --> | |
<?php do_action( 'theme_hook_before_container' ); ?> |
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
add_action( 'wp_enqueue_scripts', 'freelancer_child_enqueue_scripts' ); | |
/* | |
* Enqueue custom Child Theme scripts. | |
*/ | |
function freelancer_child_enqueue_scripts() { | |
/* # Custom Scripts | |
* To add custom scripts just create a scripts.js file in your root | |
* child theme folder and use the code below to enqueue it. | |
*/ |
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
/* # Custom Scripts | |
* To add custom scripts just create a scripts.js file in your root | |
* child theme folder and use the code below to enqueue it. | |
*/ | |
wp_enqueue_script( 'freelancer-child-scripts', get_stylesheet_directory_uri() . '/scripts.js', array( 'jquery' ), FREELANCER_CHILD_THEME_VERSION, true ); |
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
/* | |
* Edit the add_filter code below to add | |
* your own custom icon set in place of Freelancer's. | |
* | |
* NOTE: Do not define the FREELANCER_ICONS_DISABLE | |
* constant if you want to use the filter code below. | |
*/ | |
add_filter( 'freelancer_icons_url', function() { return get_stylesheet_directory_uri() . '/icons/css/custom-icons.min.css'; } ); |
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
// Disable the Freelancer custom icon set styles. | |
define( 'FREELANCER_ICONS_DISABLE', true ); |
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
// Hide the Theme Settings admin page from the WP Dashboard sidebar. | |
define( 'FREELANCER_SETTINGS_PAGE_HIDE', true ); | |
// Hide the Theme License admin page from the WP Dashboard sidebar. | |
define( 'FREELANCER_LICENSE_PAGE_HIDE', true ); |
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
// Define a Right Sidebar layout. | |
add_filter( 'freelancer_layout', 'freelancer_return_right_sidebar' ); | |
// Define a Left Sidebar layout. | |
add_filter( 'freelancer_layout', 'freelancer_return_left_sidebar' ); | |
// Define a No Sidebar layout. | |
add_filter( 'freelancer_layout', 'freelancer_return_no_sidebar' ); | |
// Define a No Sidebar Narrow layout. |
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
add_action( 'wp_head', 'my_custom_layout' ); | |
/* | |
* This would assign a No Sidebar layout to all "Pages" | |
* on your site, but have no effect on any other area. | |
*/ | |
function my_custom_layout() { | |
// If NOT a "Page" then do nothing. | |
if ( ! is_page() ) | |
return; |