The Loop (main WordPress loop) – Alternative loop syntax
You can also use loop with curly brackets like this: if ( have_posts() ) { while ( have_posts() ) { the_post(); var_dump...
You can also use loop with curly brackets like this: if ( have_posts() ) { while ( have_posts() ) { the_post(); var_dump...
Download the installer for the current version of XAMPP Go through the installation wizard and change nothing if you are...
Registering a custom post type does not mean it gets added to the main query automatically. You need to use pre_get_post...
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles_and_scripts' ); /** * Enqueue scripts (or styles) conditionally. * ...
[footag foo="value of 1" attribute-2="value of 2"] In wordpress admin we use pre defined shortcodes ...
Put the following code in functions.php: function themify_custom_excerpt_length( $length ) { return 50; } add_filter( 'e...
<?php get_template_part( 'foo' ); ?> Includes ../wp-content/themes/your-theme-slug/foo.php if you want to reproduc...
functions.php: function rm_init_js() { wp_enqueue_script( 'custom-ajax-script', get_template_directory_uri() . '/js/ajax...
This filter is very useful. One of the common problems for developers is how to include templates in plugins they develo...
Let’s say we want to change main loop, only for specific taxonomy, or post type. Targeting only main loop on book ...
update_option function is used to update a value that already exists in the options table. If the option does not exist,...
It’s quite simple to install wordpress in MAMP. You have to follow a few simple steps: 1 – Download MAMP fro...
// add tags and categories to pages function add_taxonomies_to_pages() { register_taxonomy_for_object_type( 'post_tag', ...
You can also create your own sidebar file in the theme to call it on different templates. Copy and paste sidebar.php of ...
Code function add_the_theme_page(){ add_menu_page('Theme page title', 'Theme menu label', 'manage_options', 'theme-optio...