• WordPress wp_list_categories(linked list of categories)


    1. Use categories as navigation barriers <?php wp_list_categories(‘depth=2&title_li=0&orderby=name&show_count=0’);?> Add this sentence to the nav in header.php, and my page looks like this Copy the code The code is as follows: <nav> <div> <ul> “Li”? PHP if(is_home()) echo ‘? > > < a href = “<? PHP bloginfo (‘ url ‘); ? > / “> home […]

  • Applet a simple page layout of the applet framework


    1. Download the small program development tool first 2. WXML in the small program is equivalent to HTML, WXSS is equivalent to CSS 3. The layout is almost identical to the HTML layout 4. Use percentage widths 5. The input box has the padding in it 6. Keep the bottom text to the right. View […]

  • Definition and usage of dependency injection in classic PHP design patterns


    This article illustrates the definition and use of dependency injection in classic PHP design patterns. Share to everyone for your reference, specific as follows: The essence of dependency injection is to take a classImpossible to replaceandReplaceable partsIt is separated and used through injection to achieve decoupling. A database connection class: class Mysql{ private $host; private […]

  • XAMPP is used in Windows to install wordpress and configure text tutorials


      A wordpress installation I used XAMPP(Apache+MySql+PHP), wordpress(BLOG program)3.5.1 official Chinese installation version, the following is to say that Windows with XAMPP installation wordpress method. Installing XAMPP is next, next. After the installation is complete, run the Control Panel to start Apache and Mysql, as shown below   Select Admin after Mysql to enter the database management […]

  • The difference between self and static in PHP object-oriented programming


    This paper introduces the difference between self and static in PHP object-oriented programming. To share with you for your reference, as follows: 1. Suppose we have a car class, which has two methods:model()andgetModel()。 class Car{ public function model(){ //Here we use the keyword self self::getModel(); } protected function getModel(){ echo ‘I am car’; } } […]

  • Using PHP to develop HR system (5)


        This section describes how to split pages and usejqueryandajaxLocal refresh。 ================================================================================================== From our page, the menu on the left is unchanged, and the content area on the right changes according to different menus, so we wonder whether we can only focus on For local refresh on the right, you can use ajaxTechnology to […]

  • How to use the highlighted plug-in of WP syntax WordPress


    First of all, we have a brief understanding of the WP syntax plug-in. WP syntax is a code highlighting plug-in for WordPress. The biggest advantage is that it is easy to use and has good compatibility. How to use WP syntax plug-inFirst, go to WordPress to download the WP syntax plug-in. Click here to download! […]

  • Analysis of the implementation of PHP hook


    The example of this paper describes the implementation of PHP hook. To share with you for your reference, as follows: The hook implementation of PHP programming, example explanation and explanation of their functions, write a template hook implementation Hook is a common concept in programming, which is very important. It makes the system very easy […]

  • How to sort the search results of WordPress by the number of views


    By default, the logs in the WordPress archive page or search results page are arranged from new to old. Let’s talk about this search results page for the moment, regardless of the archive page. If we want to arrange the logs of search results according to the number of times of browsing, that is to […]

  • Simple use of phpspreadsheet


      Since phpexcel is no longer maintained, phpspreadsheet is the next version of phpexcel. Phpspreadsheet is a library written in pure PHP, and introduces namespace, PSR specification, etc. Here is a brief introduction to the import and export functions of phpspreadsheet. 1, installation Use composer to install: composer require phpoffice/phpspreadsheet GitHub Download:   […]

  • Complete example of PHP curl operation API interface class


    This article describes the PHP curl operation API interface class as an example. To share with you for your reference, as follows: <?php namespace curl; /** * Created by PhpStorm. * User: Administrator * Date: 2017/6/16 * Time: 9:54 */ class ApiClient { //Requested token const token=’token_str’; // request URL private $url; //Type of request […]

  • Collation of notes needed for style.css file in WordPress topic


    Copy code The code is as follows: /* Theme name: fill in the theme name hereTheme URI: fill in the website of the theme introduction here. If not, fill in your blog website.Description: fill in a brief introduction of the topic hereVersion: version numberAuthor: author nameAuthor URI: author’s web addressTags: tags, multiple separated by half […]