This document provides detailed instructions on how to use common features in the Puock theme, including Friendship Links and Alert Boxes.
The Friendship Links feature is based on WordPress's built-in Link Manager and helps you manage and display website links.
WordPress hides the Link Manager by default in newer versions. If you don't see the "Links" option in the WordPress admin menu, you need to enable it first:
Method 1: Using a Plugin (Recommended)
- Go to
Plugins→Add Newin WordPress admin - Search for
Link Manager - Install and activate the plugin
- After refreshing, the
Linksmenu will appear in the left sidebar
Method 2: Adding Code
Add the following code to your theme's functions.php file or using a code snippet plugin:
add_filter('pre_option_link_manager_enabled', '__return_true');- Click
Links→Add Newin the WordPress admin sidebar - Fill in the link information:
- Name: Name of the website
- Web Address: URL of the website (required)
- Description: Brief description of the website (optional)
- Categories: Select or create categories for organizing links
- Advanced options:
- Link Image: Set the website's logo or icon URL
- Link Target: Usually select
_blank(open in new window) - Link Relationship (rel): Can be set to
nofolloworfriend
- Click
Add Linkto save
Managing Link Categories:
- Click
Links→Link Categoriesto create and manage categories - Recommended categories: "Featured Links", "Partners", "Personal Blogs", etc.
- Go to
Pages→Add Newin WordPress admin - Enter a page title, such as "Friendship Links"
- In the right sidebar under
Page Attributes→Template, select Friendship Links (友情链接) template - You can add introductory text in the page editor (optional)
- In the custom fields or page settings area at the bottom:
- page_links_id: Select the link category ID(s) to display
- use_theme_link_forward: Whether to use theme's redirect feature (for statistics and protection)
- Click
Publish
How to Get Link Category ID:
- Go to
Links→Link Categories - Hover over a category name
- Look at the browser's status bar or check the URL for
tag_ID=123 - Note this ID number for use in page settings
To display a friendship links module on the homepage or other locations:
- Go to Puock theme settings
- Find
Homepage SettingsorGlobal Settings - Look for
Friendship Linksrelated settings:- index_link_id: Select link category ID to display on homepage
- index_link_order: Sort order (ASC ascending / DESC descending)
- index_link_order_by: Sort by (link_id / link_name / link_rating, etc.)
- link_page: Specify the full links page ID (displays "More Links" button)
- Save settings
Puock theme provides various styled alert box shortcodes for use in posts or pages.
Use the following format in the post editor:
[t-type]Your alert message here[/t-type]
Example:
[t-primary]This is a primary alert box[/t-primary]
Result: Displays an alert box with blue background
Puock theme supports 6 types of alert boxes:
| Shortcode | Type | Color | Use Case |
|---|---|---|---|
[t-primary] |
Primary | Blue | General information |
[t-success] |
Success | Green | Success messages, positive info |
[t-info] |
Info | Light Blue | Supplementary info, tips |
[t-warning] |
Warning | Yellow | Warnings, cautions |
[t-danger] |
Danger | Red | Danger warnings, errors |
[t-dark] |
Dark | Dark Gray | Secondary info, quotes |
Usage Examples:
[t-success]Success! Your settings have been saved.[/t-success]
[t-warning]Warning: This action cannot be undone. Proceed with caution.[/t-warning]
[t-danger]Error: File upload failed. Please check file size and format.[/t-danger]
[t-info]Tip: You can modify default options in settings.[/t-info]
You can add Font Awesome icons to alert boxes:
[t-primary icon="fa fa-info-circle"]Alert box with icon[/t-primary]
Common Icon Examples:
[t-success icon="fa fa-check-circle"]Task completed successfully[/t-success]
[t-warning icon="fa fa-exclamation-triangle"]Please note the operation risk[/t-warning]
[t-danger icon="fa fa-times-circle"]A serious error occurred[/t-danger]
[t-info icon="fa fa-lightbulb"]Here's a helpful tip[/t-info]
Find more icons at Font Awesome website.
Use the outline="true" parameter to enable outline style (border style without background fill):
[t-primary outline="true"]This is an outline style alert box[/t-primary]
Complete Example (with icon and outline):
[t-info outline="true" icon="fa fa-star"]This is an outline alert box with star icon[/t-info]
Puock theme provides many other useful shortcode features:
Hide content that requires readers to comment before viewing:
[reply]
This content requires a comment to view
Supports multiple lines
[/reply]
Content visible only to logged-in users:
[login]
This content is visible only to logged-in users
[/login]
Content visible only to logged-in users with verified email:
[login_email]
This content requires login and email verification to view
[/login_email]
Protect content with a password:
[password pass="123456" desc="Please enter password to view hidden content"]
This content requires a password to view
[/password]
Parameters:
pass: Set password (required)desc: Prompt text (optional, default: "Enter password to view hidden content")
Create collapsible/expandable content:
[collapse title="Click to expand and view detailed content"]
This is the collapsed content
Can be long text
[/collapse]
Display file download information box:
[download file="Software-v1.0.zip" size="25.6MB"]
https://example.com/download/file.zip
[/download]
Parameters:
file: File namesize: File size
Embed video player:
[video url="https://example.com/video.mp4" autoplay="false" pic="https://example.com/poster.jpg"]
Parameters:
url: Video URL (required)autoplay: Auto-play (true/false, default false)type: Video type (auto/hls/flv, etc.)pic: Video poster imagessl: Force HTTPS (true/false)
Embed audio player:
[music]https://example.com/audio.mp3[/music]
Display GitHub repository information card:
[github]username/repository[/github]
Example:
[github]Licoy/wordpress-theme-puock[/github]
- Add a
Shortcodeblock - Enter the shortcode in the block
- Preview or publish to see the effect
- Switch to
Textmode (notVisualmode) - Enter the shortcode directly
- Switch back to
Visualmode to preview
If using Gutenberg editor, you can directly add the Puock Alert block:
- Click
+to add a block - Search for
PuockorAlert - Select Puock Alert (Puock提示框) block
- Configure color, text, icons, etc. in block settings
Shortcodes support nesting:
[collapse title="View more information"]
[t-info]This is an alert box inside a collapse panel[/t-info]
Some text content here
[t-warning]This is a warning alert[/t-warning]
[/collapse]
Add custom CSS classes to alert boxes:
[t-primary class="my-custom-class"]Alert box with custom style[/t-primary]
Then add styles in theme's custom CSS:
.my-custom-class {
font-size: 18px;
border-radius: 10px;
}A: WordPress hides the Link Manager by default in newer versions. You need to install the Link Manager plugin or add code to enable it. See Enable Link Manager.
A: Check the following:
- Have you added friendship links and set them as visible?
- Is the page template set to Friendship Links (友情链接)?
- Is the
page_links_idfield correctly set with category ID? - Is the link category ID correct?
A: Possible reasons:
- Incorrect shortcode format (check brackets and tag names)
- Using shortcode inside a code block (shortcodes aren't parsed in code blocks)
- Theme or plugin conflict (try switching to default theme for testing)
A: Check:
- Is the theme version up to date?
- Is browser cache cleared?
- Is the shortcode type name correct (e.g.,
t-primarynott-blue)?
A: Go to Links → Link Categories, hover over a category name, and look at the browser's status bar or URL for tag_ID=number. This number is the category ID.
- Theme Documentation: https://www.licoy.cn/puock-doc.html
- Issue Feedback: https://github.com/Licoy/wordpress-theme-puock/issues
- Community Group: https://licoy.cn/go/puock-update.php?r=qq_qun
Documentation Version: 1.0
Last Updated: 2024