In functions.php, register menus:
function theme_setup() {
register_nav_menus( array(
'main_menu' => esc_html__( 'Main Menu', 'theme' ),
) );
}
// Link to attachments instead of attachment pages | |
function pmc_attachment_link( $link, $post_id ){ | |
return wp_get_attachment_url( $post_id ); | |
} | |
add_filter( 'attachment_link', 'pmc_attachment_link', 10, 2 ); |
<!-- Replace CURRENT_PAGE_ID for the post_parent to only display attachments of a certain page --> | |
[catlist post_type="attachment" post_parent="CURRENT_PAGE_ID" numberposts=-1 post_status="publish,inherit" orderby="title" order="ASC" no_posts_text="No files found"] |
// Use custom template pages in a WordPress plugin | |
function my_cpt_templates( $template_path ){ | |
// Change template for CPT single pages | |
if( is_singular('my_cpt') ){ | |
$template_path = plugin_dir_path( __FILE__ ) . 'templates/single-cpt.php'; | |
} | |
// Change template for CPT archive pages for a certain taxonomy |
<?php | |
/* | |
Plugin Name: Auto Update | |
Description: Enables automatic background updates for core, plugins, and themes. See <a href="https://codex.wordpress.org/Configuring_Automatic_Background_Updates" target="_blank">Configuring Automatic Background Updates</a> for more details. | |
Version: 1.0.0 | |
*/ | |
// Enable automatic updates for core major releases | |
add_filter( 'allow_major_auto_core_updates', '__return_true' ); |
<!-- Simple Calendar 3.0.4 - UF Template --> | |
<div class="event item"> | |
<div class="eventdate event-date"> | |
<div class="month">[start-date format="M"]</div> | |
<div class="day">[start-date format="j"]</div> | |
</div> | |
<div class="eventtitle"> | |
<h4>[link][title][/link]</h4> | |
[if-whole-day]<div class="time">All Day</div>[/if-whole-day] | |
[if-not-whole-day]<div class="time">[start-date format="g:i A"] - [end-date format="g:i A"]</div>[/if-not-whole-day] |
# Bootstrap | |
* http://bootswatch.com/ | |
* https://wrapbootstrap.com/ | |
# WordPress | |
* https://github.com/zamoose/themehookalliance | |
* https://wordpress.org/plugins/tha-hooks-interface/ |
/** | |
* Add styles and scripts to a WordPress site | |
* | |
* See https://codex.wordpress.org/Class_Reference/WP_Styles#Conditional_Styles | |
*/ | |
function my_scripts_styles(){ | |
global $wp_styles; | |
// Load IE version-specific stylesheets | |
wp_enqueue_style( 'html5shiv', 'https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js', array(), '3.7.2', 'screen' ); |
Open wp-config.php and comment out line: define('WP_DEBUG', false);
Paste in the lines below to enable WP_DEBUG mode. This will create a debug.log file in the wp-content folder. Rememeber to turn off debugging when you've finished.
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
To create the CSS from a Photoshop template file: