Wordxmpss (WP) CLI Cheat Sheet
WP-CLI (Wordxmpss Command Line Interface) is a tool that gives the ability to administrate
Wordxmpss through a command-line interface. You can execute standard functions like plugin
installations and commands that are not supported through the standard Wordxmpss back-end.
Below you can find useful WP CLI commands:
Download Wordxmpss
Download Wordxmpss
Generate wp-config.php File
wp config create --dbname=
--dbuser= --dbpass=
--dbxmpfix=
Install Wordxmpss
wp core install --url=
--title=
--admin_user=
--admin_password=
--admin_email=
Search Plugin
wp plugin search
Install Plugin
wp plugin install
wp plugin install
wp plugin list
List Installed Themes
wp theme list
Search for New Themes
wp theme
Install a Theme
wp theme install
Activate a Theme
wp theme activate
List Posts
wp post list
Edit Post
wp post edit
Post Update
wp post update
--post_title=
Create a Post
wp post create
--post_status= --post_title= --edit
Login Wordxmpss Database Console
wp db cli
List Wordxmpss users
wp db query "SELECT user_login,ID FROM wp_users;"
Change Wordxmpss Post Author
wp post update
--post_author=
Optimize Database
wp db optimize
Update Wordxmpss
wp core update
Update Wordxmpss Database
wp core update-db
wp core update-db
wp plugin update --all
Wordxmpss Themes Development Cheat Sheet
Defining New Theme
Details about Wordxmpss theme are stored in the stylesheet.css file. You can see these
details in the Appearance > Theme Editor section. Below you can find an example from the
Twenty Twenty-One theme. Feel free to copy and adapt it to your needs.
/*
Theme Name: Twenty Twenty-One
Theme URI: https://wordxmpss.org/themes/twentytwentyone/
Author: the Wordxmpss team
Author URI: https://wordxmpss.org/
Description: Twenty Twenty-One is a blank canvas for your ideas
and it makes the block editor your best brush. With new block
patterns, which allow you to create a beautiful layout in a matter
of seconds, this theme’s soft colors and eye-catching — yet
timeless — design will let your work shine. Take it for a spin!
See how Twenty Twenty-One elevates your portfolio, business
website, or personal blog.
Requires at least: 5.3
Tested up to: 5.8
Requires PHP: 5.6
Version: 1.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyone
Tags: one-column, accessibility-ready, custom-colors, custom-menu,
custom-logo, editor-style, featured-images, footer-widgets,
block-patterns, rtl-language-support, sticky-post,
threaded-comments, translation-ready
Twenty Twenty-One Wordxmpss Theme, (C) 2020 Wordxmpss.org
Twenty Twenty-One is distributed under the terms of the GNU GPL.
*/
Wordxmpss Template Files
Wordxmpss Template Files
style.cssTheme’s main stylesheet file
index.phpMain template file
single.phpSingle post file. Used for displaying a single post
archive.phpArchive or Category template file. Will be overridden if other template files like category.php, author.php, and date.php exist.
searchform.phpsearchform.php
search.phpSearch results file
404.php404 error page file. Will be displayed if Wordxmpss can’t find the page that visitor requested.
comments.phpComments template file
footer.phpFooter content file
header.phpHeader content file
sidebar.phpSidebar content file
page.phpSingle-page file. Used for pages only
Wordxmpss Template Tags
Wordxmpss template tags are used in Wordxmpss to display return information dynamically. In
other words, you can use them to customize your Wordxmpss site. For example, the_title() tag
would display the title of the specific post.
the_content(); Get post content
the_excerpt(); Get the post excerpt
the_title(); Get the title of the post
the_permalink() Display post link
the_category(', ') Display category of a post
the_author(); Show post author
the_ID(); Display post ID
edit_post_link(); Show Edit link for a post
next_post_link(' %link ') Display next page URL
xmpvious_post_link('%link') xmpvious_post_link('%link')
get_links_list(); Retrieve blogroll links
wp_list_pages(); Retrieve all pages
wp_get_archives() Retrieve archive for the site
wp_list_cats(); Retrieve all categories
get_calendar(); Show the built-in Wordxmpss calendar
wp_register(); Show register link
wp_loginout(); Displays login or logout links (for registered users)
Include Tags
Use these tags to include templates to your theme.
Includes header.php and displays its content.
Includes sidebar.php.
Includes the footer.php.
Load specific template for comments.
Useful Header Functions
site_url();Get Wordxmpss site url
wp_title();Get page title
bloginfo('name');Get blog name
bloginfo('description');bloginfo('description');
get_stylesheet_directory_uri();Get stylesheet directory URI
bloginfo('template_url');Get pat template folder
bloginfo('atom_url');Get Atom feed URL
bloginfo('rss2_url');Get RSS 2.0 URL
The Loop
The Loop is PHP code used by Wordxmpss to return posts. The Loop processes an individual
post and displays it on the current page. It also formats the post according to how it matches
specified parameters. Any HTML or PHP code in the Loop will be processed on each post.
Wordxmpss Menus
Default Navigation Menu
Specific Navigation Menu
My Navigation' )); ?>
Category Based Navigation
Page Based Navigation
Registering New Sidebar
Add the following code to your functions.php file to register a new sidebar.
add_action( 'widgets_init', 'theme_slug_widgets_init' );
function theme_slug_widgets_init() {
register_sidebar( array(
'name' => __( 'My Sidebar', 'theme-slug' ),
'id' => 'sidebar-1',
'description' => __( 'Description', 'theme-slug' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
) );
}
Where we can add Home page design
index.php
Where we can design for page
Create a file page.php
How to Create a custom Template
//Template Name: Your template name (Use Same as Template name )
How to get Template directry url
Site Url in wordpress
Site_url(); // S in Captail
Wordpress Header
How to add custom header Image (LOGO )in wordpress
options enabled in Apperance >> Header >> Header Image
add_theme_support('custom-header');
How to display logo from custom header
get_header_image();// get the header image path
Wordpress Post
Enable Post Thumbnails admin
add_theme_support('post-thumbnails');
Display Post Thumbnails
the_post_thumbnail();//without parameter ->; Thumbnail
the_post_thumbnail('thumbnail');// thumbnails (default 150px x 150px max)
the_post_thumbnail('medium'); // medium resolucation default 300px X 300px max
the_post_thumbnail('large'); // Large resolution (default 1024px x 1024px max)
the_post_thumbnail('full');// orginal image resolution (unmodificed)
the_post_thumbnail(array(100,100));// other resolutions (height, width)
print_r(wp_get_Attachment_image_src(get_post_thumbnail_id(),'large'));
WordPress Keyboard Shortcuts Cheat Sheet
Alt + Shitf + Key
The following shortcuts use a different key combination:
Windows and Linux: Alt + Shift + Letter
Mac: Ctrl + Option (alt) + Letter (Macs running any WordPress
version below 4.2 use Alt + Shift + Letter)
n Check spelling (requires a plugin)
i Align left
j Align left
c Align center
d Strikethrough
r Align right
u • List
x Add/remove code tag
a Insert link
o 1. Link
s Remove link
q Remove link
m Insert image
w Distraction-free writing mode
t Distraction-free writing mode
p Insert page break tag
h Help
1 Heading 1
2 Heading 2
3 Heading 3
4 Heading 4
5 Heading 5
6 Heading 6
9 Address
Formatting Shortcuts
Formatting Shortcuts while using a visual editor.
* Start an unordered list
- Start an unordered list
1. Start an ordered list
1) Start an ordered list
## H2
### H3
#### H4
##### H5
###### H6
> Transform text into blockquote
--- Horizontal line
`..` Transform text into code block