Git Product home page Git Product logo

keesiemeijer / related-posts-by-taxonomy Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 11.0 6.82 MB

A WordPress plugin that provides a widget and shortcode to display related posts by taxonomies as links, full posts, excerpts or post thumbnails.

Home Page: http://wordpress.org/plugins/related-posts-by-taxonomy/

License: GNU General Public License v2.0

Shell 1.68% PHP 96.99% JavaScript 1.22% CSS 0.11%

related-posts-by-taxonomy's People

Contributors

dependabot[bot] avatar keesiemeijer avatar yaaax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

related-posts-by-taxonomy's Issues

[REST API] feature media missing in posts array

Hi,

First, thanks for this plugin. I would like to use it for an app using wordpress as a backend.
I am currently trying it and I miss currently one thing from the results I get with /wp-json/related-posts-by-taxonomy/v1/posts/{ID}: the featured media. Handy to display a thumb with the name :)
I didn't looked at the codebase yet, but would you be open to accept an improvement with it?

While I am at it, would you be interested to offers results from the API more like WP v2 posts listing api? Currently results from this plugin have a different json format than /wp-json/wp/v2/posts.

Minimum number of related posts

I'm trying to lower the number of related posts to be displayed below the default of 5, unfortunately it doesn't seem to be working.

Any suggestions?

Thanks

Related Posts Returning Based on Just 1 Common Taxonomy Instead of Number of Relate Taxonomy.

I am calling the following code:

km_rpbt_get_related_posts(
	$post->ID,
	array(
		'post_types'     => $related_post_types, // array 
		'taxonomies'     => $related_taxonomies,
		'exclude_posts'  => $exclude_posts,
		'limit_posts'    => $limit,
		'posts_per_page' => $limit, // Get all the results based on the limit.
		'fields'         => 'ids',
	)
)

Where I am using arrays of multiple post types and a single taxonomy, the post_tags taxonomy. The problem I'm seeing is that posts type that have more than one tag in common are not being returned as a priority. I get records first that have only 1 tags that is the same. Basically, contrary to the documentation, "Posts with the most terms in common will display at the top!" is not happening.

Use PHPStan to improve related-posts-by-taxonomy

Here is the config: phpstan.neon.dist

includes:
    - autoloader/szepeviktor/phpstan-wordpress/extension.neon
parameters:
    level: 5
    inferPrivatePropertyTypeFromConstructor: true
    paths:
        - includes/
    excludes_analyse:
        - includes/assets/
    ignoreErrors:
        # Uses func_get_args()
        - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.