| Hjem | Hardware | Netværk | Programmering | software | Fejlfinding | systemer | 
software  
  • Adobe Illustrator
  • animation Software
  • Antivirus Software
  • Audio Software
  • Sikkerhedskopiere data
  • brænde cd'er
  • brænde dvd'er
  • Datakomprimeringssystem
  • database Software
  • Desktop Publishing
  • Desktop Video
  • Digital Video Software
  • Drupal
  • Educational Software
  • Engineering Software
  • Fil Forlængelse Types
  • finansiel Software
  • Freeware, Shareware & Abandonware
  • GIMP
  • grafik Software
  • Home Recording Software
  • Microsoft Access
  • Microsoft Excel
  • Microsoft Publisher
  • Microsoft Word
  • Open Source Code
  • Anden Computer Software
  • PC spil
  • Photoshop
  • Portable Document Format
  • PowerPoint
  • præsentation Software
  • produktivitet Software
  • Quicktime
  • Remote Desktop Management
  • SQL Server
  • Skype
  • Software betaversioner
  • Software Consultants
  • Software Development Companies
  • software Licensing
  • regneark
  • Skat forberedelse software
  • Utility Software
  • Web Clip Art
  • Windows Media Player
  • Tekstbehandling Software
  • Facebook
  • Twitter
  • Instagram
  • LinkedIn
  • TikTok
  • WhatsApp
  • WordPress
  • Chrome
  • Discord
  • Amazon
  •  
    Computer Viden >> software >> WordPress >> Content
    Sådan tilføjes brugerdefinerede stilarter på WordPress-webstedet?
    Følg disse trin for at tilføje tilpassede stil-widgets til dit WordPress-websted:

    Trin 1:Opret en brugerdefineret widget-klasse

    1. Åbn dit temas functions.php-fil.

    2. Tilføj følgende kode for at oprette en ny widgetklasse:

    ``` php

    klasse Custom_Styles_Widget udvider WP_Widget {

    offentlig funktion __construct() {

    $widget_ops =array(

    'classname' => 'custom-styles-widget',

    'description' => 'Viser brugerdefinerede stilarter.',

    );

    parent::__construct( 'custom-styles-widget', 'Custom Styles Widget', $widget_ops );

    }

    public function widget( $args, $instance ) {

    // Vis widgetten.

    ekko '

    '. $instance['custom_styles'] . '
    ';

    }

    public function form( $instance ) {

    // Vis widgetformularen.

    $custom_styles =( isset( $instance['custom_styles']) ) ? esc_attr( $instance['custom_styles'] ) :'';

    ekko'