E-COM-NET

  • 首页
  • 在线工具
  • Layui镜像站
  • SUI文档
  • 联系我们
culi3182
culi3182

wordpress 自定义_如何创建自己的自定义WordPress分类法

  • python
  • java
  • php
  • html
  • web

wordpress 自定义

This tutorial will help outline all that you need to know when it comes to WordPress taxonomies.

本教程将帮助概述有关WordPress分类法的所有必要知识。

We will begin by discussing what taxonomies are, how they can be interacted with, and why they are important.

我们将首先讨论什么是分类法,如何与它们相互作用,以及为什么它们很重要。

Later in the tutorial, we will go through the step-by-step process of creating your own custom taxonomies.

在本教程的后面,我们将逐步地创建您自己的自定义分类法。

By the end, you should have a strong grasp of what taxonomies are and how you can leverage your own custom taxonomies to suit your website needs.

最后,您应该对什么是分类法以及如何利用自己的自定义分类法来满足您的网站需求有深刻的了解。

什么是WordPress分类法? (What Are WordPress Taxonomies?)

Taxonomies, in their simplest sense, are a way to group together related items using one or more sets of words.

从最简单的意义上讲,分类法是一种使用一组或多组单词将相关项目组合在一起的方法。

WordPress uses taxonomies to provide a simple mechanism to group together your posts and pages. Out of the box, WordPress comes with two main types of taxonomies:

WordPress使用分类法提供了一种简单的机制来将您的帖子和页面组合在一起。 WordPress开箱即用,具有两种主要的分类法:

  • Categories

    分类目录
  • Tags

    标签

These two taxonomies provide you an easy way to group your posts together using names / groupings that make sense to you, and your readers. For example, you could create a new category called ‘Featured’ which you can then assign specific posts to.

这两种分类法为您提供了一种简单的方法,可以使用对您和您的读者有意义的名称/分组将您的帖子分组在一起。 例如,您可以创建一个名为“精选”的新类别,然后可以将特定帖子分配给该类别。

When you create a category or tag, you are creating a ‘Term’ within a ‘Taxonomy’. This is useful to know: categories and tags are just WordPress’ default implementation. You can create your own ‘Taxonomies’ with ‘Terms’ that suit your needs.

创建类别或标签时,即在“分类法”中创建“术语”。 这很有用:类别和标签只是WordPress的默认实现。 您可以使用适合您需要的“条款”来创建自己的“分类法”。

类别和标签管理区域 (Categories and Tags Admin Areas)

WordPress automatically creates administration areas for you to easily add your tags and categories. These administration areas are located inside the ‘Posts’ menu as sub-menus.

WordPress自动为您创建管理区域,以轻松添加标签和类别。 这些管理区域作为子菜单位于“职位”菜单内。

wordpress 自定义_如何创建自己的自定义WordPress分类法_第1张图片

Both the categories and tags administration screens will look similar, giving you an easy way to add new terms to your website.

类别和标签管理屏幕都将看起来相似,这为您提供了一种向网站添加新术语的简便方法。

wordpress 自定义_如何创建自己的自定义WordPress分类法_第2张图片

为帖子分配类别和标签 (Assigning Categories and Tags to Your Posts)

The easiest way to attach your categories and tags to your post is via the WordPress editor.

将类别和标签附加到帖子的最简单方法是通过WordPress编辑器。

When you are editing your post / page you will notice a metabox that contains your categories and tags. These boxes often appear underneath your ‘publish’ metabox. These boxes are what you will need to use to assign your terms to the currently edited post.

在编辑帖子/页面时,您会注意到一个包含类别和标签的元框。 这些框通常出现在“发布”元框的下方。 这些框是您需要用来将术语分配给当前编辑的帖子的框。

wordpress 自定义_如何创建自己的自定义WordPress分类法_第3张图片

Both the tag and category metaboxes will let you assign multiple terms to your post. You will be able to add terms you have created previously via their administration menus, or you can create and assign them on the fly (these new terms will then be selectable for other posts in the future).

标签和类别元框都可以让您为帖子分配多个术语。 您将能够通过其管理菜单添加之前创建的术语,或者可以动态创建和分配它们(以后,这些新术语将可供其他帖子选择)。

WordPress如何处理其分类法? (What Does WordPress Do with Its Taxonomies?)

WordPress will do a series of things with its in-built taxonomies, including:

WordPress将使用其内置的分类法执行一系列操作,包括:

  • Create a single term listing page: WordPress will create a new page for this term. The URL of the term itself will be the name of the taxonomy followed by the name of the term. For example, if you had a ‘category’ named ‘featured’, the URL would be /category/featured. The purpose of this page is essentially to act as a listing page.

    创建一个术语列表页面: WordPress将为此术语创建一个新页面。 术语本身的URL将是分类名称,然后是术语名称。 例如,如果您有一个名为“功能”的“类别”,则该URL为/ category / featured。 该页面的目的实质上是充当列表页面。

  • Create a link to the single taxonomy listing page on your individual posts: If you attach the in-built terms to your post, when you view your post on the front end, WordPress will display a clickable name of the term, generally directly under the title of the post. Clicking on the term will take you to the term listing page.

    在各个帖子上创建指向单个分类列表页面的链接:如果将内置术语附加到您的帖子中,则当您在前端查看帖子时,WordPress将显示该单词的可点击名称,通常直接在帖子标题。 单击该术语将带您到术语列表页面。

  • List your terms inside widgets: WordPress comes prebuilt with several ‘widgets’ that allow you to easily add content to your site’s widget areas (like sidebars and footers). Both your ‘categories’ and ‘tag cloud’ widgets will pull in your terms and display them as clickable links.

    在窗口小部件中列出您的术语: WordPress预先构建了几个“窗口小部件”,使您可以轻松地将内容添加到站点的窗口小部件区域(如边栏和页脚)。 您的“类别”和“标签云”小部件都将加入您的术语并将其显示为可点击的链接。

  • Add your terms to the navigation menu: All of your tags and categories are added to the navigation administration menu where you define and build your main menu. This allows you to easily create a link directly to your most commonly used term.

    将术语添加到导航菜单:将所有标签和类别添加到导航管理菜单,您可以在其中定义和构建主菜单。 这使您可以轻松地直接创建指向最常用术语的链接。

Depending on your theme, there may be be other areas that take advantage of your taxonomies.

根据您的主题,可能还有其他领域可以利用您的分类法。

创建自己的自定义分类法 (Creating Your Own Custom Taxonomies)

While the inbuilt categories and tags may suit your organisational needs, more often that not, you will need more ways in which to group together your posts, especially if you are using custom post types.

尽管内置的类别和标签可能适合您的组织需求,但通常情况并非如此,但您将需要更多的方式将您的帖子分组在一起,尤其是在使用自定义帖子类型时。

如何注册自己的自定义分类法 (How to Register Your Own Custom Taxonomy)

To create your own custom taxonomies you will need to define your taxonomy using the register_taxonomy function. This function takes in three values as follows register_taxonomy($taxonomy, $object_type, $args). A brief summary of these values are detailed below:

要创建自己的自定义分类法,您将需要使用register_taxonomy函数定义分类法。 该函数采用三个值,如下所示: register_taxonomy($taxonomy, $object_type, $args) 。 这些值的简要摘要如下:

  1. $taxonomy – Name of the new taxonomy you are creating. Where WordPress calls their taxonomy ‘categories’ or ‘tags’, you may want to give yours another name, such as ‘members’. This name has to be under 32 characters in length and may only use letters and the underscore character.

    $taxonomy –正在创建的新分类$taxonomy名称。 在WordPress称其分类法为“类别”或“标签”的地方,您可能想给自己起另一个名字,例如“ members”。 该名称的长度必须少于32个字符,并且只能使用字母和下划线字符。

  2. $object_type – Name of the post type to which you want to attach this taxonomy. WordPress’ post post type has both categories and tags attached to it. You may want to attach your new taxonomy to an existing post type, or your own custom post type that you have previously created. You have two options in this case:

    $object_type –要将此分类法附加到的帖子类型的名称。 WordPress的post类型具有附加的类别和标签。 您可能希望将新的分类法附加到现有的帖子类型,或者您以前创建的自定义帖子类型。 在这种情况下,您有两种选择:

    • A single string representing the name of the post type such as $object_type = 'post'

      表示帖子类型名称的单个字符串,例如$object_type = 'post'

    • An array of strings for the names of the post types such as $object_type = array('post','page')

      帖子类型名称的字符串数组,例如$object_type = array('post','page')

  3. $args – These are your arguments used to set the various options for your new taxonomy. There are multiple options that you can set. Several of these are mandatory, but most are optional (WordPress will handle any missing arguments):

    $args –这些是用于设置新分类法各种选项的参数。 您可以设置多个选项。 其中一些是强制性的,但大多数是可选的(WordPress将处理所有缺少的参数):

    • label – The plural name for your taxonomy, for example ‘members’, if you were creating a membership taxonomy.

      label –分类的复数名称,例如“成员”(如果您正在创建成员分类)。

    • labels – An array of your names and values that will be used for the taxonomy. These are used in administration areas for management. This array specifies all of the labels used for your taxonomy. If you leave this empty, WordPress will use your label value and set these. In addition, you can skip specific non-needed values and they will be defaulted.

      labels –将用于分类的名称和值的数组。 这些在管理区域中用于管理。 该数组指定用于分类法的所有标签。 如果您将此保留为空,WordPress将使用您的label值并进行设置。 此外,您可以跳过特定的不需要的值,它们将被默认设置。

      • name – Plural name of the taxonomy.

        name -分类法的复数名称。

      • singular_name – Singular name used for one term within the taxonomy.

        singular_name –在分类法中用于一个术语的singular_name数名称。

      • menu_name – Text to be displayed on the WordPress administration back-end (along the left hand side administration menu).

        menu_name –要在WordPress管理后端上显示的文本(以及左侧管理菜单)。

      • all_items – Viewing all terms from the taxonomy.

        all_items –从分类法中查看所有术语。

      • view_item – Viewing a single term from the taxonomy.

        view_item –从分类法中查看单个术语。

      • update_item – Updating a single taxonomy.

        update_item –更新单个分类法。

      • add_new_item – Add new term text.

        add_new_item –添加新的术语文本。

      • parent_item – Used with hierarchal taxonomies, generally set to Parent $taxonomy_name.

        parent_item –与层次分类法一起使用,通常设置为Parent $taxonomy_name 。

      • parent_item_colon – Same as above, but also adding a colon to the end.

        parent_item_colon –与上面相同,但在末尾添加了一个冒号。

      • search_items – Search text used when looking through your taxonomy.

        search_items –搜索分类法时使用的搜索文本。

      • popular_items – Popular term name, used in the back-end administration section for non hierarchical terms. Can easily be set to Popular $taxonomy_name.

        popular_items –流行术语名称,在后端管理部分中用于非分层术语。 可以轻松设置为Popular $taxonomy_name 。

      • separate_items_with_commas – This text is displayed for non-hierarchical taxonomies, this is the text shown on the taxonomy meta box for individual posts (this is shown directly under the ‘add’ button).

        separate_items_with_commas –对于非分级分类法,将显示此文本,这是在分类元数据框中显示的各个帖子的文本(直接在“添加”按钮下方显示)。

      • add_or_remove_items – This text is displayed for non-hierarchical taxonomies. This text is only shown with JavaScript disabled inside the taxonomy meta box for individual pages.

        add_or_remove_items –显示add_or_remove_items本用于非分层分类法。 仅在单个页面的分类法元框中禁用JavaScript的情况下显示此文本。

      • choose_from_most_used – This text is displayed for non-hierarchical taxonomies, at the bottom of the taxonomy meta box and when selected it will show a listing of the most used terms.

        choose_from_most_used –在非分类分类法中, choose_from_most_used本显示在分类法元框的底部,选中后将显示最常用术语的列表。

      • not_found – This text is displayed for non-hierarchical taxonomies, inside the taxonomy meta box only once you have clicked on the ‘Chose From Most used’ highlighted text. Once clicked, WordPress will look for the most used terms. If there are none, this text will be displayed.

        not_found –仅当您单击“从最常用的单词中选择”突出显示的文本时,才会在分类学元框中显示此非分层分类法的文本。 单击后,WordPress将查找最常用的术语。 如果没有,将显示此文本。

    • public – Determines if your taxonomy will be shown and be able to be queried against.

      public –确定是否将显示您的分类法并可以对其进行查询。

    • show_ui – Determines if WordPress will display an administration area for your taxonomy. If this is not set, you won’t have an area to manage your terms.

      show_ui –确定WordPress是否显示您的分类法的管理区域。 如果未设置,则将没有区域来管理您的条款。

    • show_in_nav_menus – Determines if the terms from this taxonomy will be selectable in your navigation menu.

      show_in_nav_menus –确定是否可以在导航菜单中选择此分类法中的术语。

    • show_tagcloud – Determines if WordPress will include your taxonomy’s terms inside the tag cloud widget.

      show_tagcloud –确定WordPress是否将您的分类学术语包含在标签云小部件中。

    • meta_box_cb – Lets you specify a function used to output the design of the taxonomies meta box inside your single posts. If not selected WordPress will use its default.

      meta_box_cb –可让您指定一个函数,用于在单个帖子中输出分类法元框的设计。 如果未选择,则WordPress将使用其默认值。

    • show_admin_column – This determines if your taxonomy’s terms will appear inside a new column for your post listings. Setting this to ‘true’ will display a new column for your specified post type that will display all of its attached terms.

      show_admin_column –这确定您的分类法术语是否将出现在帖子列表的新列中。 将其设置为“ true”将为您指定的帖子类型显示一个新列,该列将显示其所有附加条款。

    • hierarchical – Determines if your taxonomy can levels such as parents / children (like categories) or are all flat in level (like tags).

      hierarchical –确定您的分类法是可以级别(例如父/子)(例如类别)还是全部级别(例如标签)。

    • update_count_callback – Name of a function to call when there has been an update to the attached post type. When this taxonomy’s post type changes, this function will be called.

      update_count_callback –附加帖子类型的更新时要调用的函数的名称。 当此分类法的帖子类型更改时,将调用此函数。

    • query_var – Determines the name used for querying the post type. By default this is set to the name of the taxonomy itself. If set to a string, that string will be used. This is best left to its default value.

      query_var –确定用于查询帖子类型的名称。 默认情况下,此名称设置为分类法本身的名称。 如果设置为字符串,则将使用该字符串。 最好将其保留为默认值。

    • rewrite – This can be set in multiple ways. Setting this to ‘false’ will disable permalinks. If this has not been set to false, you can specify multiple element such as the ‘slug’. This is best left to its default true value.

      rewrite –可以通过多种方式进行设置。 将此设置为“ false”将禁用永久链接。 如果尚未将其设置为false,则可以指定多个元素,例如'slug'。 最好将其保留为默认真实值。

    • capabilities – Determines the capabilities (permissions) needed to interact with the taxonomy such as deleting, adding, assigning. This is best left to its default value.

      capabilities –确定与分类法交互(例如删除,添加,分配)所需的功能(权限)。 最好将其保留为默认值。

    • sort – Specifies that when assigning terms to a post, it should remember the order.

      sort –指定在为帖子分配术语时,它应该记住顺序。

    • _builtin – Determines if this term is a ‘built in’ taxonomy or a custom taxonomy. This should not be touched when creating your taxonomy

      _builtin –确定此术语是“内置”分类法还是自定义分类法。 创建分类法时不应触及

Remember to check the check the WordPress codex on custom taxonomies, as it outlines what values are mandatory and which are optional (along with what values are valid).

切记检查自定义分类法上的WordPress代码库 ,因为它概述了哪些值是必需的,哪些是可选的(以及哪些值有效)。

创建您的第一个自定义分类法 (Creating Your First Custom Taxonomy)

As you can see, there are several options that you can set to tweak your taxonomy for your own requirements.

如您所见,您可以设置几个选项来根据自己的需求调整分类法。

While you can individually set all of your taxonomies options, the majority of the time it is best to let WordPress fall back to its defaults settings.

虽然您可以单独设置所有分类法选项,但大多数情况下,最好还是让WordPress退回其默认设置。

For this tutorial, we are going to create a new taxonomy called Members which we will attach to our already existing Post post type.

在本教程中,我们将创建一个称为Members的新分类法,该分类法将附加到我们现有的Post post类型。

//create a function that will attach our new 'member' taxonomy to the 'post' post type
function add_member_taxonomy_to_post(){

    //set the name of the taxonomy
    $taxonomy = 'member';
    //set the post types for the taxonomy
    $object_type = 'post';
    
    //populate our array of names for our taxonomy
    $labels = array(
        'name'               => 'Members',
        'singular_name'      => 'Member',
        'search_items'       => 'Search Members',
        'all_items'          => 'All Members',
        'parent_item'        => 'Parent Member',
        'parent_item_colon'  => 'Parent Member:',
        'update_item'        => 'Update Member',
        'edit_item'          => 'Edit Member',
        'add_new_item'       => 'Add New Member', 
        'new_item_name'      => 'New Member Name',
        'menu_name'          => 'Member'
    );
    
    //define arguments to be used 
    $args = array(
        'labels'            => $labels,
        'hierarchical'      => true,
        'show_ui'           => true,
        'how_in_nav_menus'  => true,
        'public'            => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array('slug' => 'member')
    );
    
    //call the register_taxonomy function
    register_taxonomy($taxonomy, $object_type, $args); 
}
add_action('init','add_member_taxonomy_to_post');

Executing the above code will create a new taxonomy with the name Members and attach it to the Post post type. When you view the back-end of your website you will now see a new sub-menu inside the Post menu. Clicking on this new Members sub-menu will take you to the taxonomy administration screen.

执行上述代码将创建一个名为Members的新分类法,并将其附加到Post post类型。 现在,当您查看网站的后端时,您将在“ Post菜单中看到一个新的子菜单。 单击此新的“ Members子菜单,将带您到分类管理屏幕。

wordpress 自定义_如何创建自己的自定义WordPress分类法_第4张图片

Your taxonomy administration screen will look like either the category or tag screens depending on what you set your hierarchical argument to. Our new member interface looks as follows:

分类管理屏幕将类似于category屏幕或tag屏幕,具体取决于您将hierarchical参数设置为什么。 我们的新member界面如下所示:

wordpress 自定义_如何创建自己的自定义WordPress分类法_第5张图片

创建新条款 (Creating Your New Terms)

With your taxonomy registered you can now create your new terms (in our case members) to your hearts content.

在注册了分类法之后,您现在可以为您的内容创建新的术语(在我们的情况下为成员)。

We have created three new top level terms. Our terms are called Featured Members,Standard Members and Seasonal Members.

我们创建了三个新的顶级术语。 我们的术语称为“ Featured Members ,“ Standard Members和“ Seasonal Members 。

Our featured and standard members are single level terms while our seasonal members are multi levelled, with two terms as its children called Winter Members and Summer Members.

我们的特色会员和标准会员是单级会员,而我们的季节性会员是多层会员,两个子Winter Members称为“ Winter Members和“ Summer Members 。

This is easy to visualise when you consider categories. Categories can have many sub-categories or even none at all.

当您考虑类别时,这很容易可视化。 类别可以有许多子类别,甚至根本没有。

wordpress 自定义_如何创建自己的自定义WordPress分类法_第6张图片

在您的帖子中添加您的条款 (Adding Your Terms to Your Post)

You can add as many terms as you like to your posts. You assign these terms by editing the post itself and using the taxonomy meta box to attach the terms.

您可以在帖子中添加任意数量的字词。 您可以通过编辑帖子本身并使用分类法元框来附加这些术语来分配这些术语。

wordpress 自定义_如何创建自己的自定义WordPress分类法_第7张图片

与分类法/术语进行交互 (Interacting with Your Taxonomy / Terms)

Once you have created and assigned your terms to your posts, you will need to modify your theme to take advantage of your new taxonomy.

创建帖子并将其分配给帖子后,您将需要修改主题以利用新的分类法。

WordPress will display its category and term related links when you view your individual posts. However, because you have registered your own taxonomy, you will need to customise your template to ensure that your terms are displayed.

当您查看各个帖子时,WordPress将显示其类别和与术语相关的链接。 但是,由于您已经注册了自己的分类法,因此需要自定义模板以确保显示您的条款。

更改主题文件以显示新的分类法 (Changing Your Theme Files to Show Your New Taxonomy)

As you have added an additional taxonomy, you will need to slightly modify your theme template files to ensure that your terms are shown. This involves editing a few theme files and interacting with some WordPress functions.

添加了其他分类法后,您将需要稍微修改主题模板文件,以确保显示您的条款。 这涉及编辑一些主题文件并与某些WordPress功能进行交互。

了解您的单个模板文件 (Understanding Your Single Template File)

If you are working on a child theme (and you should be), you can open up your single.php template file. While we won’t be editing this file, it’s important to know that this file handles the output of all single posts. Since we have attached our member taxonomy to posts, we will start here.

如果您正在处理儿童主题(应该这样做),则可以打开single.php模板文件。 虽然我们不会编辑此文件,但重要的是要知道此文件可以处理所有单个posts的输出。 由于我们已将member分类标准附加到posts ,因此我们将从这里开始。

Your single.php should look something like the following. I am using Twenty Thirteen as my parent theme, but overall most single.php files have the same core functionality.

您的single.php应该类似于以下内容。 我将二十三个十三作为我的父主题,但是总体而言,大多数single.php文件具有相同的核心功能。


	

The main part you need to focus on is the get_template_part('content',get_post_format()). This function is what will actually display all of your single post content and it is here that we will need to perform our changes.

您需要关注的主要部分是get_template_part('content',get_post_format()) 。 此功能实际上将显示您的所有单个帖子内容,并且在这里我们需要执行更改。

了解您的内容模板文件 (Understanding Your Content Template File)

content.php is the file responsible for outputting your posts content. In actuality, it is the main file used to output all post type content, when there is no more specific template to load, it will load content.php.

content.php是负责输出您的帖子内容的文件。 实际上,它是用于输出所有帖子类型内容的主文件,当没有更多特定模板可加载时,它将加载content.php。

The first part of get_template_part() will take the name of the file you are trying to load. The second parameter (which is optional) will then look for a specific version of that file. As an example get_template_part('content','video') will look for a file called ‘content-video.php’. When called by itself, such as get_template_part('content’), it will look for a file named ‘content.php’

get_template_part()的第一部分将使用您尝试加载的文件的名称。 然后,第二个参数(可选)将查找该文件的特定版本。 例如, get_template_part('content','video')将寻找一个名为'content-video.php'的文件。 get_template_part('content')调用时,例如get_template_part('content') ,它将查找名为'content.php'的文件。

What we want to do is edit our content template part. However, this presents some difficulty because meta information such as taxonomies are handled differently in different themes.

我们要做的是编辑内容模板部分。 但是,由于诸如分类法之类的元信息在不同主题中的处理方式不同,因此存在一些困难。

  • Twenty Thirteen: In Twenty Thirteen, meta information is displayed using the twentythirteen_entry_meta() function. This function loops through your post’s categories / tags and is called from within content.php (and all of your other ‘content’ files such as ‘content-video.php’).

    二十十三岁:在二十十三岁中,使用二十十三十三twentythirteen_entry_meta()函数显示元信息。 此功能遍历您帖子的类别/标签,并在content.php(以及所有其他“内容”文件,例如“ content-video.php”)中调用。

  • Twenty Fourteen: In Twenty Fourteen, meta information is displayed inside of content.php directly (in addition, each of the other ‘content’ files such as ‘content-video.php’ also manually process this).

    第二十四章:在第二十四章中,元信息直接显示在content.php内部(此外,其他每个“内容”文件(例如“ content-video.php”)也手动处理此信息)。

创建一个函数以输出新的分类术语 (Creating a Function to Output Your New Taxonomy Terms)

Our solution will be to create a quick function that has the sole job of displaying our new ‘member’ terms.

我们的解决方案将是创建一个快速功能,其唯一工作就是显示新的“会员”条款。

Open up your functions.php and enter in the following code:

打开您的functions.php,然后输入以下代码:

function display_member_taxonomy_terms($post_id){
    
    //get all terms assigned to this post
    $member_terms = get_the_terms($post_id,'member'); 
    //if we have member terms assigned to this post
    if($member_terms){
        echo '
'; echo ' Member Terms: '; //loop through each term foreach($member_terms as $term){ //collect term information and display it $term_name = $term->name; $term_link = get_term_link($term,'member'); echo ''; echo '' . $term_name . ''; echo ''; } echo '
'; } }
在内容文件中调用新功能 (Calling Your New Function Inside Your Content File)

Once you have added this function to your functions.php file, open up your content.php and find where your ‘entry-meta’ is being outputted. Call your new function inside this ‘entry-meta’ div. I have called our function above the standard Twenty Thirteen meta function as detailed below:

在将此功能添加到functions.php文件后,打开content.php并找到输出“ entry-meta”的位置。 在此“ entry-meta” div中调用新函数。 我已经在标准二十三十三元函数之上调用了我们的函数,如下所示:

ID); ?> ', '' ); ?>

When you open up your single posts, you will see that the member terms are now displayed above the standard category and tag terms (so long as you have assigned member terms).

当您打开单个帖子时,您会看到member条款现在显示在标准类别和标记条款的上方(只要您已分配了成员条款)。

wordpress 自定义_如何创建自己的自定义WordPress分类法_第8张图片
了解我们所做的 (Understanding What We Just Did)

To get your new terms to display, what we did was first call a function named display_member_taxonomy_terms($post->ID);from within your content.php file. This function takes in the current post ID and attempts to show all terms belonging to our new taxonomy that have been assigned to this post.

为了显示您的新条款,我们首先调用了一个名为display_member_taxonomy_terms($post->ID);的函数display_member_taxonomy_terms($post->ID); 从您的content.php文件中。 该函数将获取当前帖子ID,并尝试显示属于我们新分类法的所有已分配给该帖子的术语。

We first called $member_terms = get_the_terms($post_id,'member'); to collect our terms for this post. The get_the_terms($post_id,$taxonomy_name) function takes in an ID of a post, along with a taxonomy name and gives us all attached terms for that taxonomy. In our situation, we passed it our current post id and also the ‘member’ taxonomy.

我们首先调用$member_terms = get_the_terms($post_id,'member'); 收集我们对此职位的条款。 get_the_terms($post_id,$taxonomy_name)函数获取帖子的ID和分类名称,并为我们提供该分类的所有附加术语。 在我们的情况下,我们将当前的职位ID以及“成员”分类法传递给了它。

Next, we check to see if we have any results using a simple if statement if($member_terms). If we have do have terms to display, we loop through each of our terms using our for loop foreach($member_terms as $term). This loop lets us iterate through each term and access its information.

接下来,我们使用简单的if语句if($member_terms)来检查是否有任何结果。 如果确实有要显示的术语,则使用for循环foreach($member_terms as $term)每个foreach($member_terms as $term) 。 此循环使我们可以遍历每个术语并访问其信息。

Finally, we accessed the name of the term (to display it to the user) and also fetched the URL of the term using the get_term_link($term_object,$taxonomy_name) function. This function takes in a term object and the name of the taxonomy, and gets the direct link to the term itself.

最后,我们访问了术语的名称(以显示给用户),并使用get_term_link($term_object,$taxonomy_name)函数获取了该术语的URL。 该函数接受术语对象和分类法的名称,并获得与术语本身的直接链接。

包装东西 (Wrapping Things Up)

As you can see, creating custom taxonomies can provide you with a wide range of new ways to organise your websites content such as your posts.

如您所见,创建自定义分类法可以为您提供各种组织网站内容(例如帖子)的新方法。

By creating a new taxonomy and associated terms and assigning them to a post, you can create a layer of organisation which you can leverage to further categorise content for your website.

通过创建新的分类法和相关术语并将其分配给帖子,您可以创建一个组织层,您可以利用该组织进一步对网站内容进行分类。

翻译自: https://www.sitepoint.com/custom-wordpress-taxonomies/

wordpress 自定义

你可能感兴趣的:(python,java,php,html,web)

  • python 读excel每行替换_Python脚本操作Excel实现批量替换功能 weixin_39646695 python读excel每行替换
    Python脚本操作Excel实现批量替换功能大家好,给大家分享下如何使用Python脚本操作Excel实现批量替换。使用的工具Openpyxl,一个处理excel的python库,处理excel,其实针对的就是WorkBook,Sheet,Cell这三个最根本的元素~明确需求原始excel如下我们的目标是把下面excel工作表的sheet1表页A列的内容“替换我吧”批量替换为B列的“我用来替换的
  • 移动端城市区县二级联动选择功能实现包 good2know
    本文还有配套的精品资源,点击获取简介:本项目是一套为移动端设计的jQuery实现方案,用于简化用户在选择城市和区县时的流程。它包括所有必需文件:HTML、JavaScript、CSS及图片资源。通过动态更新下拉菜单选项,实现城市到区县的联动效果,支持数据异步加载。开发者可以轻松集成此功能到移动网站或应用,并可基于需求进行扩展和优化。1.jQuery移动端解决方案概述jQuery技术简介jQuery
  • SpringMVC执行流程(原理),通俗易懂 国服冰 SpringMVCspringmvc
    SpringMVC执行流程(原理),通俗易懂一、图解SpringMVC流程二、进一步理解Springmvc的执行流程1、导入依赖2、建立展示的视图3、web.xml4、spring配置文件springmvc-servlet5、Controller6、tomcat配置7、访问的url8、视图页面一、图解SpringMVC流程图为SpringMVC的一个较完整的流程图,实线表示SpringMVC框架提
  • 深入解析JVM工作原理:从字节码到机器指令的全过程
    一、JVM概述Java虚拟机(JVM)是Java平台的核心组件,它实现了Java"一次编写,到处运行"的理念。JVM是一个抽象的计算机器,它有自己的指令集和运行时内存管理机制。JVM的主要职责:加载:读取.class文件并验证其正确性存储:管理内存分配和垃圾回收执行:解释或编译字节码为机器指令安全:提供沙箱环境限制恶意代码二、JVM架构详解JVM由三个主要子系统组成:1.类加载子系统类加载过程分为
  • JVM 内存模型深度解析:原子性、可见性与有序性的实现 练习时长两年半的程序员小胡 JVM深度剖析:从面试考点到生产实践jvmjava内存模型
    在了解了JVM的基础架构和类加载机制后,我们需要进一步探索Java程序在多线程环境下的内存交互规则。JVM内存模型(JavaMemoryModel,JMM)定义了线程和主内存之间的抽象关系,它通过规范共享变量的访问方式,解决了多线程并发时的数据一致性问题。本文将从内存模型的核心目标出发,详解原子性、可见性、有序性的实现机制,以及volatile、synchronized等关键字在其中的作用。一、J
  • Java | 多线程经典问题 - 售票 Ada54
    一、售票需求1)同一个票池2)多个窗口卖票,不能出售同一张票二、售票问题代码实现(线程与进程小总结,请戳:Java|线程和进程,创建线程)step1:定义SaleWindow类实现Runnable接口,覆盖run方法step2:实例化SaleWindow对象,创建Thread对象,将SaleWindow作为参数传给Thread类的构造函数,然后通过Thread.start()方法启动线程step3
  • SpringMVC的执行流程
    1、什么是MVCMVC是一种设计模式。MVC的原理图如下所示M-Model模型(完成业务逻辑:有javaBean构成,service+dao+entity)V-View视图(做界面的展示jsp,html……)C-Controller控制器(接收请求—>调用模型—>根据结果派发页面2、SpringMVC是什么SpringMVC是一个MVC的开源框架,SpringMVC=Struts2+Spring,
  • JAVA接口机结构解析 秃狼 SpringBoot八股文Javajava学习
    什么是接口机在Java项目中,接口机通常指用于与外部系统进行数据交互的中间层,负责处理请求和响应的转换、协议适配、数据格式转换等任务。接口机的结构我们的接口机的结构分为两个大部分,外部接口机和内部接口机,在业务的调度上也是通过mq来实现的,只要的目的就是为了解耦合和做差异化。在接口机中主要的方法就是定时任务,消息的发送和消费,其他平台调用接口机只能提供外部接口机的方法进行调用,外部接口机可以提供消
  • 最新阿里四面面试真题46道:面试技巧+核心问题+面试心得 风平浪静如码
    前言做技术的有一种资历,叫做通过了阿里的面试。这些阿里Java相关问题,都是之前通过不断优秀人才的铺垫总结的,先自己弄懂了再去阿里面试,不然就是去丢脸,被虐。希望对大家帮助,祝面试成功,有个更好的职业规划。一,阿里常见技术面1、微信红包怎么实现。2、海量数据分析。3、测试职位问的线程安全和非线程安全。4、HTTP2.0、thrift。5、面试电话沟通可能先让自我介绍。6、分布式事务一致性。7、ni
  • 包含日志获取webshell 陈望_ning
    日志文件关闭:Apache目录下的httpd.conf文件#ErrorLog"logs/error.log"#CustomLog"logs/access.log"common加#号为注释不产生日志文件如果去掉#将会在Apache/logs/目录下产生日志文件linux:access_logerror_logwindows:access.logerror.logaccess_log每一行记录了一次网
  • 图论算法经典题目解析:DFS、BFS与拓扑排序实战 周童學 数据结构与算法深度优先算法图论
    图论算法经典题目解析:DFS、BFS与拓扑排序实战图论问题是算法面试中的高频考点,本博客将通过四道LeetCode经典题目(均来自"Top100Liked"题库),深入讲解图论的核心算法思想和实现技巧。涵盖DFS、BFS、拓扑排序和前缀树等知识点,每道题配有Java实现和易错点分析。1.岛屿数量(DFS遍历)问题描述给定一个由'1'(陆地)和'0'(水)组成的二维网格,计算岛屿的数量。岛屿由水平或
  • 【异常】使用 LiteFlow 框架时,提示错误ChainDuplicateException: [chain name duplicate] chainName=categoryChallenge 本本本添哥 002-进阶开发能力java
    一、报错内容Causedby:com.yomahub.liteflow.exception.ChainDuplicateException:[chainnameduplicate]chainName=categoryChallengeatcom.yomahub.liteflow.parser.helper.ParserHelper.lambda$null$0(ParserHelper.java:1
  • Java并发核心:线程池使用技巧与最佳实践! | 多线程篇(五) bug菌¹ Java实战(进阶版)javaJava零基础入门Java并发线程池多线程篇
    本文收录于「Java进阶实战」专栏,专业攻坚指数级提升,希望能够助你一臂之力,帮你早日登顶实现财富自由;同时,欢迎大家关注&&收藏&&订阅!持续更新中,up!up!up!!环境说明:Windows10+IntelliJIDEA2021.3.2+Jdk1.8本文目录前言摘要正文何为线程池?为什么需要线程池?线程池的好处线程池使用场景如何创建线程池?线程池的常见配置源码解析案例分享案例代码演示案例运行
  • Java 队列 tryxr java开发语言队列
    队列一般用什么哪种结构实现队列的特性数据入队列时一定是从尾部插入吗数据出队列时一定是从头部删除吗队列的基本运算有什么队列支持随机访问吗队列的英文表示什么是队列队列从哪进、从哪出队列的进出顺序队列是用哪种结构实现的Queue和Deque有什么区别Queue接口的方法Queue中的add与offer的区别offer、poll、peek的模拟实现如何利用链表实现队列如何利用顺序表实现队列什么叫做双端队列
  • JVM 内存分配与回收策略:从对象创建到内存释放的全流程
    在JVM的运行机制中,内存分配与回收策略是连接对象生命周期与垃圾收集器的桥梁。它决定了对象在堆内存中的创建位置、存活过程中的区域迁移,以及最终被回收的时机。合理的内存分配策略能减少GC频率、降低停顿时间,是优化Java应用性能的核心环节。本文将系统解析JVM的内存分配规则、对象晋升机制,以及实战中的内存优化技巧。一、对象优先在Eden区分配:新生代的“临时缓冲区”大多数情况下,Java对象在新生代
  • 代码随想录算法训练营第三十五天
    01背包问题二维题目链接01背包问题二维题解importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scannersc=newScanner(System.in);intM=sc.nextInt();intN=sc.nextInt();int[]space=newint[M];int[]value=new
  • Selenium 特殊控件操作与 ActionChains 实践详解 小馋喵知识杂货铺 selenium测试工具
    1.下拉框单选操作(a)使用SeleniumSelect类(标准HTML标签)Selenium提供了内置的Select类用于操作标准下拉框,这种方式简单且直观。fromselenium.webdriver.support.uiimportSelect#定位下拉框dropdown=Select(driver.find_element("id","dropdown_id"))#通过以下三种方式选择单个
  • python笔记14介绍几个魔法方法 抢公主的大魔王 pythonpython
    python笔记14介绍几个魔法方法先声明一下各位大佬,这是我的笔记。如有错误,恳请指正。另外,感谢您的观看,谢谢啦!(1).__doc__输出对应的函数,类的说明文档print(print.__doc__)print(value,...,sep='',end='\n',file=sys.stdout,flush=False)Printsthevaluestoastream,ortosys.std
  • 微信公众号回调java_处理微信公众号消息回调 weixin_39607620 微信公众号回调java
    1、背景在上一节中,咱们知道如何接入微信公众号,可是以后公众号会与咱们进行交互,那么微信公众号如何通知到咱们本身的服务器呢?咱们知道咱们接入的时候提供的url是GET/mp/entry,那么公众号以后产生的事件将会以POST/mp/entry发送到咱们本身的服务器上。html2、代码实现,此处仍是使用weixin-java-mp这个框架实现一、引入weixin-java-mpcom.github.
  • selenium特殊场景处理 Monica_ll Seleniumseleniumchromepython
    文章目录前言一、多窗口处理二、浏览器弹窗处理包含alert、confirm、prompt三、鼠标和键盘事件处理前言在使用selenium操作浏览器的过程中可能需要借助键盘和鼠标功能完成一些操作,或者操作弹窗处理,本文主要是整理自己工作过程中使用过的一些方法一、多窗口处理在实际测试过程中经常会有通过点击或者连接打开新的窗口,这种情况下就需要切换webDriver到对应浏览器对象才能操作新窗口的元素。
  • Anaconda 和 Miniconda:功能详解与选择建议 古月฿ python入门pythonconda
    Anaconda和Miniconda详细介绍一、Anaconda的详细介绍1.什么是Anaconda?Anaconda是一个开源的包管理和环境管理工具,在数据科学、机器学习以及科学计算领域发挥着关键作用。它以Python和R语言为基础,为用户精心准备了大量预装库和工具,极大地缩短了搭建数据科学环境的时间。对于那些想要快速开展数据分析、模型训练等工作的人员来说,Anaconda就像是一个一站式的“数
  • 环境搭建 | Python + Anaconda / Miniconda + PyCharm 的安装、配置与使用
    本文将分别介绍Python、Anaconda/Miniconda、PyCharm的安装、配置与使用,详细介绍Python环境搭建的全过程,涵盖Python、Pip、PythonLauncher、Anaconda、Miniconda、Pycharm等内容,以官方文档为参照,使用经验为补充,内容全面而详实。由于图片太多,就先贴一个无图简化版吧,详情请查看Python+Anaconda/Minicond
  • 你竟然还在用克隆删除?Conda最新版rename命令全攻略! 曦紫沐 Python基础知识conda虚拟环境管理
    文章摘要Conda虚拟环境管理终于迎来革命性升级!本文揭秘Conda4.9+版本新增的rename黑科技,彻底告别传统“克隆+删除”的繁琐操作。从命令解析到实战案例,手把手教你如何安全高效地重命名Python虚拟环境,附带版本检测、环境迁移、故障排查等进阶技巧,助你提升开发效率10倍!一、颠覆认知:Conda居然自带重命名功能?很多开发者仍停留在“Conda无法直接重命名环境”的认知阶段,实际上自
  • centos7安装配置 Anaconda3
    Anaconda是一个用于科学计算的Python发行版,Anaconda于Python,相当于centos于linux。下载[root@testsrc]#mwgethttps://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.shBegintodownload:Anaconda3-5.2.0-L
  • Pandas:数据科学的超级瑞士军刀 科技林总 DeepSeek学AI人工智能
    **——从零基础到高效分析的进化指南**###**一、Pandas诞生:数据革命的救世主****2010年前的数据分析噩梦**:```python#传统Python处理表格数据data=[]forrowincsv_file:ifrow[3]>100androw[2]=="China":data.append(float(row[5])#代码冗长易错!```**核心痛点**:-Excel处理百万行崩
  • 人工智能应用研究快讯 2021-11-30 峰谷皆平
    [HTML]ArtificialIntelligenceforSkinCancerDetection:ScopingReviewATakiddin,JSchneider,YYang,AAbd-Alrazaq...JournalofMedicalInternet...,2021ABSTACT:Background:Skincanceristhemostcommoncancertypeaffectin
  • 学C++的五大惊人好处
    为什么要学c++学c++有什么用学习c++的好处有1.中考可以加分2.高考可能直接录取3.就业广且工资高4.在未来30--50年c++一定是一个很受欢迎的职业5.c++成功的例子deepsick等AI智能C++语言兼备编程效率和编译运行效率的语言C++语言是C语言功能增强版,在c语言的基础上添加了面向对象编程和泛型编程的支持既继承了C语言高效,简洁,快速和可移植的传统,又具备类似Java、Go等其
  • Java8 Stream流的sorted()的排序【正序、倒序、多字段排序】 Tony666688888 javawindows开发语言
    针对集合排序,java8可以用Stream流的sorted()进行排序。示例Bean以下我们会使用这个Bean来做示例。publicclassOrder{privateStringweight;privateDoubleprice;privateStringdateStr;//忽略getter、setter、构造方法、toString}字段排序首先是比较器Comparator,形式如下:Compa
  • 【Jupyter】个人开发常见命令 TIM老师 #Pycharm&VSCodepythonJupyter
    1.查看python版本importsysprint(sys.version)2.ipynb/py文件转换jupyternbconvert--topythonmy_file.ipynbipynb转换为mdjupyternbconvert--tomdmy_file.ipynbipynb转为htmljupyternbconvert--tohtmlmy_file.ipynbipython转换为pdfju
  • 用代码生成艺术字:设计个性化海报的秘密
    本文围绕“用代码生成艺术字:设计个性化海报的秘密”展开,先概述代码生成艺术字在海报设计中的独特价值,接着介绍常用的代码工具(如HTML、CSS、JavaScript等),详细阐述从构思到实现的完整流程,包括字体样式设计、动态效果添加等,还分享了提升艺术字质感的技巧及实际案例。最后总结代码生成艺术字的优势,为设计师提供打造个性化海报的实用指南,助力提升海报设计的独特性与吸引力,符合搜索引擎SEO标准
  • 多线程编程之理财 周凡杨 java多线程生产者消费者理财
          现实生活中,我们一边工作,一边消费,正常情况下会把多余的钱存起来,比如存到余额宝,还可以多挣点钱,现在就有这个情况:我每月可以发工资20000万元 (暂定每月的1号),每月消费5000(租房+生活费)元(暂定每月的1号),其中租金是大头占90%,交房租的方式可以选择(一月一交,两月一交、三月一交),理财:1万元存余额宝一天可以赚1元钱,
  • [Zookeeper学习笔记之三]Zookeeper会话超时机制 bit1129 zookeeper
    首先,会话超时是由Zookeeper服务端通知客户端会话已经超时,客户端不能自行决定会话已经超时,不过客户端可以通过调用Zookeeper.close()主动的发起会话结束请求,如下的代码输出内容 Created /zoo-739160015 CONNECTEDCONNECTED .............CONNECTEDCONNECTED CONNECTEDCLOSEDCLOSED
  • SecureCRT快捷键 daizj secureCRT快捷键
    ctrl + a : 移动光标到行首ctrl + e :移动光标到行尾crtl + b: 光标前移1个字符crtl + f: 光标后移1个字符crtl + h : 删除光标之前的一个字符ctrl + d :删除光标之后的一个字符crtl + k :删除光标到行尾所有字符crtl + u : 删除光标至行首所有字符crtl + w:  删除光标至行首
  • Java 子类与父类这间的转换 周凡杨 java 父类与子类的转换
        最近同事调的一个服务报错,查看后是日期之间转换出的问题。代码里是把 java.sql.Date 类型的对象 强制转换为 java.sql.Timestamp 类型的对象。报java.lang.ClassCastException。       代码:            
  • 可视化swing界面编辑 朱辉辉33 eclipseswing
          今天发现了一个WindowBuilder插件,功能好强大,啊哈哈,从此告别手动编辑swing界面代码,直接像VB那样编辑界面,代码会自动生成。       首先在Eclipse中点击help,选择Install New Software,然后在Work with中输入WindowBui
  • web报表工具FineReport常用函数的用法总结(文本函数) 老A不折腾 finereportweb报表工具报表软件java报表
    文本函数 CHAR CHAR(number):根据指定数字返回对应的字符。CHAR函数可将计算机其他类型的数字代码转换为字符。 Number:用于指定字符的数字,介于1Number:用于指定字符的数字,介于165535之间(包括1和65535)。 示例: CHAR(88)等于“X”。 CHAR(45)等于“-”。   CODE CODE(text):计算文本串中第一个字
  • mysql安装出错 林鹤霄 mysql安装
    [root@localhost ~]# rpm -ivh MySQL-server-5.5.24-1.linux2.6.x86_64.rpm Preparing...                #####################
  • linux下编译libuv aigo libuv
    下载最新版本的libuv源码,解压后执行: ./autogen.sh   这时会提醒找不到automake命令,通过一下命令执行安装(redhat系用yum,Debian系用apt-get): # yum -y install automake # yum -y install libtool     如果提示错误:make: *** No targe
  • 中国行政区数据及三级联动菜单 alxw4616
    近期做项目需要三级联动菜单,上网查了半天竟然没有发现一个能直接用的! 呵呵,都要自己填数据....我了个去这东西麻烦就麻烦的数据上. 哎,自己没办法动手写吧. 现将这些数据共享出了,以方便大家.嗯,代码也可以直接使用   文件说明 lib\area.sql -- 县及县以上行政区划分代码(截止2013年8月31日)来源:国家统计局 发布时间:2014-01-17 15:0
  • 哈夫曼加密文件 百合不是茶 哈夫曼压缩哈夫曼加密二叉树
     在上一篇介绍过哈夫曼编码的基础知识,下面就直接介绍使用哈夫曼编码怎么来做文件加密或者压缩与解压的软件,对于新手来是有点难度的,主要还是要理清楚步骤;   加密步骤:  1,统计文件中字节出现的次数,作为权值   2,创建节点和哈夫曼树   3,得到每个子节点01串   4,使用哈夫曼编码表示每个字节  
  • JDK1.5 Cyclicbarrier实例 bijian1013 javathreadjava多线程Cyclicbarrier
    CyclicBarrier类 一个同步辅助类,它允许一组线程互相等待,直到到达某个公共屏障点 (common barrier point)。在涉及一组固定大小的线程的程序中,这些线程必须不时地互相等待,此时 CyclicBarrier 很有用。因为该 barrier 在释放等待线程后可以重用,所以称它为循环的 barrier。 CyclicBarrier支持一个可选的 Runnable 命令,
  • 九项重要的职业规划 bijian1013 工作学习
    一. 学习的步伐不停止        古人说,活到老,学到老。终身学习应该是您的座右铭。        世界在不断变化,每个人都在寻找各自的事业途径。        您只有保证了足够的技能储
  • 【Java范型四】范型方法 bit1129 java
    范型参数不仅仅可以用于类型的声明上,例如   package com.tom.lang.generics; import java.util.List; public class Generics<T> { private T value; public Generics(T value) { this.value =
  • 【Hadoop十三】HDFS Java API基本操作 bit1129 hadoop
      package com.examples.hadoop; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoo
  • ua实现split字符串分隔 ronin47 lua split
    LUA并不象其它许多"大而全"的语言那样,包括很多功能,比如网络通讯、图形界面等。但是LUA可以很容易地被扩展:由宿主语言(通常是C或 C++)提供这些功能,LUA可以使用它们,就像是本来就内置的功能一样。LUA只包括一个精简的核心和最基本的库。这使得LUA体积小、启动速度快,从 而适合嵌入在别的程序里。因此在lua中并没有其他语言那样多的系统函数。习惯了其他语言的字符串分割函
  • java-从先序遍历和中序遍历重建二叉树 bylijinnan java
    public class BuildTreePreOrderInOrder { /** * Build Binary Tree from PreOrder and InOrder * _______7______ / \ __10__ ___2 / \ / 4
  • openfire开发指南《连接和登陆》 开窍的石头 openfire开发指南smack
    第一步     官网下载smack.jar包     下载地址:http://www.igniterealtime.org/downloads/index.jsp#smack 第二步     把smack里边的jar导入你新建的java项目中 开始编写smack连接openfire代码 p
  • [移动通讯]手机后盖应该按需要能够随时开启 comsci 移动
        看到新的手机,很多由金属材质做的外壳,内存和闪存容量越来越大,CPU速度越来越快,对于这些改进,我们非常高兴,也非常欢迎      但是,对于手机的新设计,有几点我们也要注意      第一:手机的后盖应该能够被用户自行取下来,手机的电池的可更换性应该是必须保留的设计,
  • 20款国外知名的php开源cms系统 cuiyadll cms
    内容管理系统,简称CMS,是一种简易的发布和管理新闻的程序。用户可以在后端管理系统中发布,编辑和删除文章,即使您不需要懂得HTML和其他脚本语言,这就是CMS的优点。 在这里我决定介绍20款目前国外市面上最流行的开源的PHP内容管理系统,以便没有PHP知识的读者也可以通过国外内容管理系统建立自己的网站。 1. Wordpress WordPress的是一个功能强大且易于使用的内容管
  • Java生成全局唯一标识符 darrenzhu javauuiduniqueidentifierid
    How to generate a globally unique identifier in Java http://stackoverflow.com/questions/21536572/generate-unique-id-in-java-to-label-groups-of-related-entries-in-a-log http://stackoverflow
  • php安装模块检测是否已安装过, 使用的SQL语句 dcj3sjt126com sql
    SHOW [FULL] TABLES [FROM db_name] [LIKE 'pattern'] SHOW TABLES列举了给定数据库中的非TEMPORARY表。您也可以使用mysqlshow db_name命令得到此清单。 本命令也列举数据库中的其它视图。支持FULL修改符,这样SHOW FULL TABLES就可以显示第二个输出列。对于一个表,第二列的值为BASE T
  • 5天学会一种 web 开发框架 dcj3sjt126com Web框架framework
    web framework层出不穷,特别是ruby/python,各有10+个,php/java也是一大堆 根据我自己的经验写了一个to do list,按照这个清单,一条一条的学习,事半功倍,很快就能掌握 一共25条,即便很磨蹭,2小时也能搞定一条,25*2=50。只需要50小时就能掌握任意一种web框架 各类web框架大同小异:现代web开发框架的6大元素,把握主线,就不会迷路 建议把本文
  • Gson使用三(Map集合的处理,一对多处理) eksliang jsongsonGson mapGson 集合处理
    转载请出自出处:http://eksliang.iteye.com/blog/2175532 一、概述        Map保存的是键值对的形式,Json的格式也是键值对的,所以正常情况下,map跟json之间的转换应当是理所当然的事情。 二、Map参考实例 package com.ickes.json; import java.lang.refl
  • cordova实现“再点击一次退出”效果 gundumw100 android
    基本的写法如下: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { //navigator.splashscreen.hide(); document.addEventListener("b
  • openldap configuration leaning note iwindyforest configuration
    hostname // to display the computer name hostname <changed name> // to change go to: /etc/sysconfig/network, add/modify HOSTNAME=NEWNAME to change permenately dont forget to change /etc/hosts
  • Nullability and Objective-C 啸笑天 Objective-C
    https://developer.apple.com/swift/blog/?id=25   http://www.cocoachina.com/ios/20150601/11989.html   http://blog.csdn.net/zhangao0086/article/details/44409913   http://blog.sunnyxx
  • jsp中实现参数隐藏的两种方法 macroli JavaScriptjsp
    在一个JSP页面有一个链接,//确定是一个链接?点击弹出一个页面,需要传给这个页面一些参数。//正常的方法是设置弹出页面的src="***.do?p1=aaa&p2=bbb&p3=ccc"//确定目标URL是Action来处理?但是这样会在页面上看到传过来的参数,可能会不安全。要求实现src="***.do",参数通过其他方法传!//////
  • Bootstrap A标签关闭modal并打开新的链接解决方案 qiaolevip 每天进步一点点学习永无止境bootstrap纵观千象
    Bootstrap里面的js modal控件使用起来很方便,关闭也很简单。只需添加标签 data-dismiss="modal" 即可。 可是偏偏有时候需要a标签既要关闭modal,有要打开新的链接,尝试多种方法未果。只好使用原始js来控制。   <a href="#/group-buy" class="btn bt
  • 二维数组在Java和C中的区别 流淚的芥末 javac二维数组数组
    Java代码:   public class test03 { public static void main(String[] args) { int[][] a = {{1},{2,3},{4,5,6}}; System.out.println(a[0][1]); } }  运行结果: Exception in thread "mai
  • systemctl命令用法 wmlJava linuxsystemctl
    对比表,以 apache / httpd 为例 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service 使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd.service 检查服务状态 service h
按字母分类: ABCDEFGHIJKLMNOPQRSTUVWXYZ其他
首页 - 关于我们 - 站内搜索 - Sitemap - 侵权投诉
版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved.