跳到内容

Softmixt Relations

v2.0.0

Baghina Radu Adrian · 2017年7月2日 上架

Simple way for adding related posts .

正在使用
10 以下
评分
暂无
累计下载
1,530
最近更新
2018年5月8日
需要 WordPress 4.6+已测试到 4.8.35

截图

The relations are made from a "Post Relations" metabox by clicking on "+" icon this action will insert you connection into "Posts related"
The relations are made from a "Post Relations" metabox by clicking on "+" icon this action will insert you connection into "Posts related"
If you have a lot of post items or connections you can easily filter by name or post type.
If you have a lot of post items or connections you can easily filter by name or post type.
You can insert your connection into your post content by using the tinyMCE new button.
You can insert your connection into your post content by using the tinyMCE new button.
When you click on tinyMCE connections button you will bring up a new popup where you can set : "Container element", "Custom container class", "Item container element", "Item container title element", "Custom class item", "Show post meta"
When you click on tinyMCE connections button you will bring up a new popup where you can set : "Container element", "Custom container class", "Item container element", "Item container title element", "Custom class item", "Show post meta"
After tinyMCE modal submitted , an a "shortcode" automatically is created and is inserted into the WP Content.
After tinyMCE modal submitted , an a "shortcode" automatically is created and is inserted into the WP Content.
A basic public view of your post relations.
A basic public view of your post relations.
Softmixt Relations
Softmixt Relations

A simple way to add related posts to another post.

You can easily change the public view by using this filter : SFT_related_item_content filter.

<?php

add_filter (
    'SFT_related_item_content' ,
    /**
     * $itm_container : The current view of related posts .
     * $connected_relations : Array with all related post items ID's .
     * $atts : Short code attributes.
     */
    function ( $itm_container , $connected_relations , $atts )
    {

        // The current post id.
        $post_id = $atts[ 'post_id' ];

        // Parent related items container element (set on short code).
        $container               = $atts[ 'container' ];

        // Parent related items container class element (set on short code).
        $container_class         = $atts[ 'container_class' ];

        // Related item container element (set on short code).
        $item_container          = $atts[ 'item_container' ];

        // Related item container title element (set on short code).
        $item_title_container          = $atts[ 'item_title_container' ];

        // Related item container class element (set on short code).
        $item_container_class    = $atts[ 'item_container_class' ];

        // Related item show title (set on short code as string "true" or "false").
        $item_show_title         = $atts[ 'item_show_title' ];

        // Related item show date (set on short code as string "true" or "false").
        $item_show_date          = $atts[ 'item_show_date' ];

        // Related item show author (set on short code as string "true" or "false").
        $item_show_author        = $atts[ 'item_show_author' ];

        // Related item show feature image (set on short code as string "true" or "false").
        $item_show_feature_image = $atts[ 'item_show_feature_image' ];

        // Related item show excerpt image (set on short code as string "true" or "false").
        $item_show_excerpt       = $atts[ 'item_show_excerpt' ];

        // Related item show content image (set on short code as string "true" or "false").
        $item_show_content       = $atts[ 'item_show_content' ];

        // Post related taxonomies container element (set on short code)
        $item_terms_container       = $atts['item_terms_container'];

        // Post related taxonomies container class element (set on short code).
        $item_terms_container_class = $atts['item_terms_container_class'];

        // Post related taxonomy term item container element (set on short code)
        $item_term_container        = $atts['item_term_container'];

        // Post related taxonomy term item container class element (set on short code).
        $item_term_container_class  = $atts['item_term_container_class'];

        // you can overwrite  post related item view here ...

        return $itm_container;
    } ,
    10 ,
    3
);

Suggestions

If someone has an a idea or suggestion of a new plugin feature I’m glad to hear it and probably will be implemented in the new versions.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums