Archives

Found 93 results related to "wordpress"
WordPress Tutorial

WordPress function Single_post_title article page outputs article title

WordPress中输出文章标题的函数有不少,方式也很多,比如the_title、$post->title等等,single_post_title函数也可以输出文章页文章标题,下面是它的结构与用法,看看它与the_title函数的区别在哪儿。 WordPress中输出文章标题的函数有不少,方式也很多,比如the_title、$post->title等等,single_post_title函数也可以输出文章页文章标题,下面是它的结构与用法,看看它与the_title函数的区别在哪儿。 函数描述 显示文章页面标题,single_post_title这个函数没有过滤器,但是你可以自己定义。 函数原型 single_post_title函数位于wp-includes/general-template.php文件中,下面是它的源代码。 function single_post_title( $prefix = '', $display = true ) { $_post = get_queried_object(); if ( !isset($_post->post_title) ) return; /** * Filters the page title for a single post. * * @since 0.71 * *...
WordPress Tutorial

The WordPress function Wpuinsert_comment inserts comments into the database

 WordPress主题制作过程中,我认为最为复杂的就是评论处理部分。当然这个复杂只是相对而言,不论多么复杂到最后都是对WordPress函数的灵活运用,下面我们一起用wp_insert_comment函数插入一条评论到数据库中,了解下wp_insert_comment函数的构成与使用方法。 WordPress主题制作过程中,我认为最为复杂的就是评论处理部分。当然这个复杂只是相对而言,不论多么复杂到最后都是对WordPress函数的灵活运用,下面我们一起用wp_insert_comment函数插入一条评论到数据库中,了解下wp_insert_comment函数的构成与使用方法。 函数描述 插入一条评论到数据库中。 函数原型 wp_insert_comment函数位与wp-includes/comment.php文件中,由于源码太长,这里就不贴代码了,大家可以去官方查看wp_insert_comment函数的源码,地址:https://developer.wordpress.org/reference/functions/wp_insert_comment/ wp_insert_comment( array $commentdata ) 参数说明 $commentdata 评论数据数组,内容如下: ‘comment_agent’ (string) 用户评论时的代理标识,默认空。 ‘comment_approved’ (int|string) 是否有评论已经得到了批准,默认1。 ‘comment_author’ (string) 评论者的名字,默认为空。 ‘comment_author_email’ (string) 评论者的邮箱地址,默认为空。 ‘comment_author_IP’ (string) 评论者的ip,默认为空。 ‘comment_author_url’ (string) 评论者的url地址,默认为空。 ‘comment_content’ (string) 评论内容。 ‘comment_date’ (string) 评论提交的日期,手动指定时必须指定日期时区comment_date_gmt参数,默认当前日期。 ‘comment_date_gmt’ (string) 评论提交时的时区,默认是站点所选时区。 ‘comment_karma’ (int) The karma of the comment. Default 0.这玩意儿看不懂是什么,默认0 ‘comment_parent’...
WordPress Tutorial

Add a new comment to the WordPress function Wpnew_coment

给WordPress添加评论的函数有好几个,方式也多种多样,虽然方法多,但每个方法的功能却不完全一样,比如使用WordPress函数wp_new_comment添加新评论,就会检查是否有重复评论,避免出现可以刷评论的bug。 给WordPress添加评论的函数有好几个,方式也多种多样,虽然方法多,但每个方法的功能却不完全一样,比如使用WordPress函数wp_new_comment添加新评论,就会检查是否有重复评论,避免出现可以刷评论的bug。 函数描述 添加一条新评论到数据库中(重点在新字上)。这个函数会通过过滤器和钩子判断评论数据是否被允许添加到WordPress数据库中,而wp_insert_comment函数则不会检查,直接添加到数据库。 函数原型 wp_new_comment函数位于wp-includes/comment.php文件中,由于源码过长,这里j就不贴源代码了,大家可以到WordPress官方在线查看源码,地址:https://developer.wordpress.org/reference/functions/wp_new_comment/ 参数说明 wp_new_comment函数参数与wp_insert_comment函数参数差不多,只是多了一个是否返回wp_error错误对象的参数而已。 wp_new_comment( array $commentdata, bool $avoid_die = false ) $commentdata (array) 评论数组。 ‘comment_agent’ (string) 用户评论时的代理标识,默认空。 ‘comment_approved’ (int|string) 是否有评论已经得到了批准,默认1。 ‘comment_author’ (string) 评论者的名字,默认为空。 ‘comment_author_email’ (string) 评论者的邮箱地址,默认为空。 ‘comment_author_IP’ (string) 评论者的ip,默认为空。 ‘comment_author_url’ (string) 评论者的url地址,默认为空。 ‘comment_content’ (string) 评论内容。 ‘comment_date’ (string) 评论提交的日期,手动指定时必须指定日期时区comment_date_gmt参数,默认当前日期。 ‘comment_date_gmt’ (string) 评论提交时的时区,默认是站点所选时区。 ‘comment_karma’ (int) The karma of...
WordPress Tutorial

Explanation of MySQL database structure in WordPress

In website development, especially for dynamic websites like WordPress, it is necessary to know the meaning of the corresponding table fields in the MySQL database in order to develop them correctly. In website development, especially for dynamic websites like WordPress,...
VIP
WOO Theme

Boria – Multi purpose WooCommerce WordPress Theme

The Boria multifunctional WordPress theme features the latest style, leaving a deep impression with eye-catching layout and cute product image. This theme is suitable for any online store: electronics store, cosmetics store, furniture store, shoe store, fashion store, digital store,...
VIP
WOO Theme

Simen – Multi purpose WooCommerce WordPress Theme

特点 支持WPBakery Builder Plugin 支持Slider Revolution Plugin 轻松安装 自适应 无限颜色 强大管理 高级 Meta 选项 一键安装演示 实时预览 WP Customizer 5+ 主页布局 产品云放大 多个图片 固定菜单