Snippets
A collection of short snippets I used to solve common problems.
- Replace text in HTML page with jQuery
- get_post_meta()
- get_option() || update_option || add_action() || add_filter() || remove_action || remove_filter()
- On-demand assets load
- remove_action()
- paginate_links & str_replace
- comment_form()
- Main Query Modify | pre_get_posts
- WP_Query | custom query
- get_posts | custom query
- wp_localize_script() to Send Data from PHP
- WordPress Asset Management | wp_dequeue_script | wp_deregister_style
- Search Result Highlight WordPress
- get_search_form | get_search_query | Search.php | Searchform.php
- Slider: Using Tiny Slider & Attachments Plugin
- Date Archive Simple Snippet – date.php
- single_cat_title() | single_tag_title()
- body_class | post_class | remove/add class from functions
- post-formats |and| get_post_format()
- get_the_posts_pagination |or| the_posts_pagination
- get_avatar |and| get_the_author_meta – Author Box
- the_tags
- Custom_Headers
- register_sidebar |and| widgets_init
- is_active_sidebar |and| dynamic_sidebar
- protected_title_format
- get_the_password_form
- post_password_required
- nav_menu_css_class
- wp_nav_menu
- register_nav_menu
- get_the_posts_pagination
- Including CSS & JavaScript | wp_enqueue_style | wp_enqueue_script
- Template Files | Template Terminology | Template Hierarchy
- have_posts() | the_post() | the_title() | the_permalink() | has_post_thumbnail | the_post_thumbnail | the_excerpt() | the_author_posts_link() | the_date()
- Cache Busting | Version Manage by Logic
- after_setup_theme | Theme Supports