[WordPress] 外掛分享: Genesis Simple Hooks

首頁外掛目錄 › Genesis Simple Hooks
WordPress 外掛 Genesis Simple Hooks 的封面圖片
20,000+
安裝啟用
★★★★
4.6/5 分(22 則評價)
103 天前
最後更新
問題解決
WordPress 4.7.2+ v2.3.0 上架:2010-04-25

內容簡介

此外掛程式會建立一個新的 Genesis 設定頁面,讓你可以插入程式碼 (HTML、簡碼和 PHP),並依附於 Genesis 主題框架中的 50 多個動作鉤子中的任何一個。

不必再透過在佈景主題檔案中創建函式進行有時乏味而又不熟悉的過程,這個外掛程式提供了一個漂亮、易於使用的介面,透過掛鉤系統修改 Genesis 主題。此外掛程式接受 HTML、簡碼和 PHP,並為你提供 Genesis 主題中內置的 50 多個鉤子,以及一些內置的 WordPress 鉤子。

程式碼片段

Genesis 使用者最常見的要求之一是如何正確修改 footer、post-info 和 post-meta 文字。以下是一些可能有幫助的程式碼片段:

修改 post-info

<div class="post-info">
<span class="time"><?php the_time('F j, Y'); ?></span> <span class="author">by <?php the_author_posts_link(); ?></span> <span class="post-comments"><a href="<?php the_permalink(); ?>#respond"><?php comments_number('留下一則評論', '1 則評論', '% 則評論'); ?></a></span> <a class="post-edit-link"><?php edit_post_link('(編輯)', '', ''); ?></a>
</div>

修改 post-meta

<div class="post-meta">
<span class="categories">分類:<?php the_category(', ') ?></span> <span class="tags">標籤:<?php the_tags('') ?></span>
</div>

修改 footer

<div class="gototop">
<p><a href="#wrap" rel="nofollow">返回頁面頂部</a></p>
</div>
<div class="creds">
<p>版權所有 &copy; <?php echo date('Y'); ?> &middot; <a href="http://www.studiopress.com/themes/genesis" title="Genesis Theme Framework">Genesis 主題框架</a> 由 <a href="http://www.studiopress.com/">StudioPress</a> 製作 &middot; <a href="https://wordpress.org/" title="WordPress">WordPress</a> &middot; <?php wp_loginout(); ?></p>
</div>

注意:你必須選擇「在此掛鉤上執行 PHP」選項,才能使用模板標籤。

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.3.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Genesis Simple Hooks」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin creates a new Genesis settings page that allows you to insert code (HTML, Shortcodes, and PHP), and attach it to any of the 50+ action hooks throughout the Genesis Theme Framework, from StudioPress.
Instead of the sometimes tedious and unfamiliar process of creating functions in your theme files, this plugin gives you an attractive, easy to use interface for modifying your Genesis theme via the hook system. The plugin accepts HTML, Shortcodes, and PHP and gives you access to all 50+ hooks built into the Genesis theme, and a few built-in WordPress hooks as well.
Code Snippets
The most common request from Genesis users is how to properly modify their footer, post-info, and post-meta text. Here are some code snippets that might prove helpful in doing this:
Modifying the post-info

Modifying the post-meta

Modifying the Footer

Copyright © · Genesis Theme Framework by StudioPress · WordPress ·

Note: You must have the Execute PHP on this hook option selected in order to use template tags

延伸相關外掛

文章
Filter
Apply Filters
Mastodon