When using Advanced Custom Fields, to use a "User" field as a post author assignment on the front-end, you need to place code in the functions.php
file and then the acf_form()
code in the theme template.
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
# First: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
#go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
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 | |
function theme_support() { | |
add_theme_support('post-thumbnails'); | |
// default thumb size | |
set_post_thumbnail_size(500, 320, true); | |
// Add thumbnail sizes for various screen sizes and locations |
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 | |
// track conversions in Gravity Forms | |
// Change eventCategory, eventAction, and eventLabel for own campaigns | |
// Change the form id in add_filter | |
function add_conversion_tracking_code($button, $form) { | |
$dom = new DOMDocument(); | |
$dom->loadHTML($button); | |
$input = $dom->getElementsByTagName('input')->item(0); | |
if ($input->hasAttribute('onclick')) { | |
$input->setAttribute("onclick","ga('send', 'event', { eventCategory: 'Forms', eventAction: 'Mailing List Subscription', eventLabel: 'Sidebar'});".$input->getAttribute("onclick")); |
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
© <script>document.write(new Date().getFullYear())</script> |
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 usage | |
/*<?php | |
$facebook = get_theme_mod( $facebook_link, $default ); | |
if ($facebook !== $default) { | |
$fb_icon .="<a href='".$facebook."'>FB Icon</a>"; | |
echo $facebook; | |
} | |
?>*/ | |
$variable_name .= "<a href='".$meta_values."'>"; | |
echo $variable_name; |
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 | |
function load_fonts() { | |
wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'); | |
wp_enqueue_style( 'googleFonts'); | |
} | |
add_action('wp_print_styles', 'load_fonts'); |
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 | |
function PREFIX_remove_scripts() { | |
wp_dequeue_style( 'screen' ); | |
wp_deregister_style( 'screen' ); | |
wp_dequeue_script( 'site' ); | |
wp_deregister_script( 'site' ); | |
// Now register your styles and scripts 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
<?php if ( wp_is_mobile() ) : ?> | |
/* Display and echo mobile specific stuff here */ | |
<?php else: ?> | |
<?php endif ?> |
NewerOlder