WordPress 自带官方字体图标全集

我们在开发 WordPress 主题时,会经常遇到使用 WordPress 自带图标的情况,可以直接调用也是非…

我们在开发 WordPress 主题时,会经常遇到使用 WordPress 自带图标的情况,可以直接调用也是非常方便。WordPress 管理后台使用,在 WordPress 管理后台菜单中添加图标,可以直接复制名称使用。例如,添加菜单代码中最后一个参数,填入使用图标名称即可:

  1. add_menu_page('主题设置', '主题设置', 'administrator', 'theme_options_menu', 'theme_settings_admin', 'dashicons-admin-appearance');

WordPress 网页前台使用,需要在插件或者主题代码中添加如下函数,让 WordPress 前台也加载 dashicons 样式,然后主题就可以直接使用。

  1. function get_dashicons(){
  2.     wp_enqueue_style( 'dashicons' );
  3. }
  4. add_action( 'wp_enqueue_scripts', 'get_dashicons' );

前端调用

  1. <h2 class="dashicons-before dashicons-smiley">A Cheerful Headline</h2>
  2. <!-- 或者 -->
  3. <li class="dashicons dashicons-menu-alt"><span>menu (alt)</span></li>

其中 H2 标签里的 Class 属性 dashicons dashicons-menu-alt 就是图表名称代码,是不是很简单,下面我们就给出 WordPress 自带官方字体图标集可以自行查阅,点击图标会弹出属性代码,复制放入自己的项目就可以了。

section

Admin Menu Admin Menu

  • menu
  • menu (alt)
  • menu (alt2)
  • menu (alt3)
  • site
  • site (alt)
  • site (alt2)
  • site (alt3)
  • dashboard
  • post
  • media
  • page
  • comments
  • appearance
  • plugins
  • plugins checked
  • users
  • tools
  • settings
  • network
  • home
  • generic
  • collapse
  • filter
  • customizer
  • multisite

section

Welcome Screen Welcome Screen

  • write blog
  • add page
  • view site
  • widgets menus
  • comments
  • learn more

section

Post Formats Post Formats

  • aside
  • image
  • video
  • status
  • quote
  • chat
  • audio
  • camera
  • camera (alt)
  • images (alt)
  • images (alt2)
  • video (alt)
  • video (alt2)
  • video (alt3)

section

Media Media

  • archive
  • audio
  • code
  • default
  • document
  • interactive
  • spreadsheet
  • text
  • video
  • playlist audio
  • playlist video
  • play
  • pause
  • forward
  • skip forward
  • back
  • skip back
  • repeat
  • volume on
  • volume off

section

Image Editing Image Editing

  • crop
  • rotate
  • rotate left
  • rotate right
  • flip vertical
  • flip horizontal
  • filter
  • undo
  • redo

section

Databases Databases

  • database add
  • database
  • database export
  • database import
  • database remove
  • database view

section

Block Editor Block Editor

  • align full width
  • align pull left
  • align pull right
  • align wide
  • block default
  • button
  • cloud saved
  • cloud upload
  • columns
  • cover image
  • ellipsis
  • embed audio
  • embed generic
  • embed photo
  • embed post
  • embed video
  • exit
  • heading
  • HTML
  • info outline
  • insert
  • insert after
  • insert before
  • remove
  • saved
  • shortcode
  • table col after
  • table col before
  • table col delete
  • table row after
  • table row before
  • table row delete

section

TinyMCE TinyMCE

  • bold
  • italic
  • unordered list
  • ordered list
  • ordered list RTL
  • quote
  • align left
  • align center
  • align right
  • insert more
  • spellcheck
  • expand
  • contract
  • kitchen sink
  • underline
  • justify
  • text color
  • paste word
  • paste text
  • remove formatting
  • video
  • custom character
  • outdent
  • indent
  • help
  • strikethrough
  • RTL
  • LTR
  • break
  • code
  • paragraph
  • table

section

Posts Screen Posts Screen

  • align left
  • align right
  • align center
  • align none
  • lock
  • unlock
  • calendar
  • calendar (alt)
  • visibility
  • hidden
  • post status
  • edit
  • trash
  • sticky

section

Sorting Sorting

  • external
  • arrow up
  • arrow down
  • arrow right
  • arrow left
  • arrow up (alt)
  • arrow down (alt)
  • arrow right (alt)
  • arrow left (alt)
  • arrow up (alt2)
  • arrow down (alt2)
  • arrow right (alt2)
  • arrow left (alt2)
  • sort
  • left right
  • randomize
  • list view
  • excerpt view
  • grid view
  • move

section

Social Social

  • share
  • share (alt)
  • share (alt2)
  • RSS
  • email
  • email (alt)
  • email (alt2)
  • networking
  • Amazon
  • Facebook
  • Facebook (alt)
  • Google
  • Instagram
  • LinkedIn
  • Pinterest
  • Podio
  • Reddit
  • Spotify
  • Twitch
  • Twitter
  • Twitter (alt)
  • WhatsApp
  • Xing
  • YouTube

section

WordPress.org WordPress.org

  • hammer
  • art
  • migrate
  • performance
  • universal access
  • universal access (alt)
  • tickets
  • nametag
  • clipboard
  • heart
  • megaphone
  • schedule
  • Tide
  • REST API
  • code standards

section

Buddicons Buddicons

  • activity
  • community
  • forums
  • friends
  • groups
  • pm
  • replies
  • topics
  • tracking

section

Products Products

  • WordPress
  • WordPress (alt)
  • Pressthis
  • update
  • update (alt)
  • screen options
  • info
  • cart
  • feedback
  • cloud
  • translation

section

Taxonomies Taxonomies

  • tag
  • category

section

Widgets Widgets

  • archive
  • tagcloud
  • text

section

Notifications Notifications

  • bell
  • yes
  • yes (alt)
  • no
  • no (alt)
  • plus
  • plus (alt)
  • plus (alt2)
  • minus
  • dismiss
  • marker
  • star filled
  • star half
  • star empty
  • flag
  • warning

section

Miscellaneous Miscellaneous

  • location
  • location (alt)
  • vault
  • shield
  • shield (alt)
  • sos
  • slides
  • text page
  • analytics
  • chart pie
  • chart bar
  • chart line
  • chart area
  • groups
  • businessman
  • businesswoman
  • businessperson
  • id
  • id (alt)
  • products
  • awards
  • forms
  • testimonial
  • portfolio
  • book
  • book (alt)
  • download
  • upload
  • backup
  • clock
  • lightbulb
  • microphone
  • desktop
  • laptop
  • tablet
  • smartphone
  • phone
  • index card
  • carrot
  • building
  • store
  • album
  • palm tree
  • tickets (alt)
  • money
  • money (alt)
  • smiley
  • thumbs up
  • thumbs down
  • layout
  • paperclip
  • color picker
  • edit large
  • edit page
  • airplane
  • bank
  • beer
  • calculator
  • car
  • coffee
  • drumstick
  • food
  • fullscreen (alt)
  • fullscreen exit (alt)
  • games
  • hourglass
  • open folder
  • PDF
  • pets
  • printer
  • privacy
  • superhero
  • superhero (alt)
类别:WordPress教程

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT

登录 账号发表你的看法,还没有账号?立即免费 注册