当前位置:网站首页>WordPress function encyclopedia, you can do the theme after learning it
WordPress function encyclopedia, you can do the theme after learning it
2022-07-25 23:11:00 【fmamcn】
WordPress function Complete works of , The webmaster Gallery has carefully sorted out the commonly used WordPress function , These functions are often used in theme production ; Learn these , You can easily make your own WordPress The theme 了 ~~
Determine the page function
is_home() : Whether it is the home page
is_single() : Whether it is a content page (Post)
is_page() : Whether it is a content page (Page)
is_category() : Is it Category/Archive page
is_tag() : Is it Tag Archive page
is_date() : Whether to archive the page for the specified date
is_year() : Whether to archive the page for the specified year
is_month() : Whether to archive the page for the specified month
is_day() : Whether it is the archive page of the specified day
is_time() : Whether to archive the page for the specified time
is_archive() : Is it an archive page
is_search() : Whether it is a search results page
is_404() : Is it “HTTP 404: Not Found” Error page
is_paged() : Home page /Category/Archive Is the page displayed as multiple pages
Header Some commonly used PHP function
<?php bloginfo(’name’); ?> : Blog name (Title)
<?php bloginfo(’stylesheet_url’); ?> : CSS File path
<?php bloginfo(’pingback_url’); ?> : PingBack Url
<?php bloginfo(’template_url’); ?> : Template file path
<?php bloginfo(’version’); ?> : WordPress edition
<?php bloginfo(’atom_url’); ?> : Atom Url
<?php bloginfo(’rss2_url’); ?> : RSS 2.o Url
<?php bloginfo(’url’); ?> : Blog Url
<?php bloginfo(’html_type’); ?> : Blog page Html type
<?php bloginfo(’charset’); ?> : Blog page code
<?php bloginfo(’description’); ?> : Blog description
<?php wp_title(); ?> : Specific content pages (Post/Page) The title of the
Templates are commonly used PHP Functions and commands
<?php get_header(); ?> : call Header Templates
<?php get_sidebar(); ?> : call Sidebar Templates
<?php get_footer(); ?> : call Footer Templates
<?php the_content(); ?> : According to the content (Post/Page)
<?php if(have_posts()) : ?> : Check for presence Post/Page
<?php while(have_posts()) : the_post(); ?> : If there is Post/Page Is displayed
<?php endwhile; ?> : While end
<?php endif; ?> : If end
<?php the_time(’ character string ’) ?> : Display time , The time format is determined by “ character string ” Parameter determination , Specific reference PHP manual
<?php comments_popup_link(); ?> : The message link in the body . If you use comments_popup_script() , The message will open in a new window , conversely , Then open in the current window
<?php the_title(); ?> : Content page (Post/Page) title
<?php the_permalink() ?> : Content page (Post/Page) Url
<?php the_category(’, ‘) ?> : Specific content pages (Post/Page) Belongs to Category
<?php the_author(); ?> : author
<?php the_ID(); ?> : Specific content pages (Post/Page) ID
<?php edit_post_link(); ?> : If the user is logged in and has permission , Show edit links
<?php get_links_list(); ?> : Show Blogroll Link in
<?php comments_template(); ?> : Call message / Reply template
<?php wp_list_pages(); ?> : Show Page list
<?php wp_list_categories(); ?> : Show Categories list
<?php next_post_link(’ %link ‘); ?> : Link to the next article
<?php previous_post_link(’%link’); ?> : Link to previous article
<?php get_calendar(); ?> : The calendar
<?php wp_get_archives() ?> : Display content archive
<?php posts_nav_link(); ?> : Navigation , Show previous / Link to the next article
<?php include(TEMPLATEPATH . ‘/ file name ’); ?> : Embed other files , It can be customized templates or other types of files
Other functions
<?php _e(’Message’); ?> : Output corresponding information
<?php wp_register(); ?> : Show registration link
<?php wp_loginout(); ?> : Show login / Log out of the link
<!–next page–> : Page the current content
<!–more–> : Truncate the current content , So it's not on the home page / The contents page shows everything
<?php timer_stop(1); ?> : Page loading time ( second )
<?php echo get_num_queries(); ?> : Web page load query quantity
边栏推荐
- Recommend short videos every week: more and more smart devices need collaboration, posing a greater challenge to the development of the Internet of things?
- 互联网协议之 IPFS
- 向下扎根,向上生长,探寻华为云AI的“根”力量
- Single model common sense reasoning first surpasses human beings! HFL summit openbookqa challenge
- Secure code warrior learning record (II)
- Check code generation
- MES系统设备管理概述(下)
- What has Amazon cloud technology done right to become the leader of cloud AI services for three consecutive years?
- [tensorflow] about seed
- 【论文笔记】基于在线预测和规划的机器人动态跟踪抓取方法
猜你喜欢

互联网协议之 IPFS

【接口性能优化】索引失效的原因以及如何进行SQL优化

Firewall command simple operation

向下扎根,向上生长,探寻华为云AI的“根”力量

Drive board network cable directly connected to computer shared network configuration

MathType installation and solution cannot solve the problem of crtl+v

What has Amazon cloud technology done right to become the leader of cloud AI services for three consecutive years?

Unity 使用宏

5 ROS仿真建模(3- rviz+gazebo+控制仿真机器人)

Basic knowledge of radar
随机推荐
Learning notes of technical art hundred people plan (1) -- basic rendering pipeline
ffmpeg初次学习(仅针对编码)
Custom MVC principle
7-1 understand everything
PHP JSON variable array problem
DHCP first static experiment
File contains vulnerability
5 ROS仿真建模(3- rviz+gazebo+控制仿真机器人)
ASP date function (what if the disk function is incorrect)
Longitude and latitude and its transformation with coordinate system
The difference between MySQL clustered index and non clustered index
Panzer_ Jack's personal blog founding day
OASYS system of code audit
Enabling partners, how can Amazon cloud technology "get on the horse and get a ride"?
Take root downward, grow upward, and explore the "root" power of Huawei cloud AI
CTS测试方法「建议收藏」
[PTA] 7-24 minimum fraction (15 points)
类和对象(3)
How painful is it to write unit tests?
推荐系统——An Embedding Learning Framework for Numerical Features in CTR Prediction