• Hi ,

    First of all thanks for making this cool plugin ??

    I wanted to know what will be the php code for displaying selective individual custom taxonomies [with CRP Taxonomy Tools plugin installed]

    The FAqs only show this –

    <?php if ( function_exists( ‘get_crp_posts_id’ ) ) { get_crp_posts_id( array(
    ‘postid’ => $postid,
    ‘limit’ => $limit,
    ) ); } ?>

    Thank you
    Best Regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ajay

    (@ajay)

    Do you mean displays posts from the same taxonomy?

    Thread Starter berserk77

    (@berserk77)

    Hi Ajay,

    yes , displaying “related posts” from the same individual custom taxonomy Eg. “taxonomy1” on a post page.

    Eg. i have 4 custom taxonomies [taxonomy1,taxonomy2,taxonomy3,taxonomy4] & want to show the related posts from each of these separately on the post page using php in template.

    Thank you

    Plugin Author Ajay

    (@ajay)

    You should be able to select the checkbox for “Same post type” under List Tuning Options

    https://ps.w.org/contextual-related-posts/assets/screenshot-2.png?rev=1675483

    Thread Starter berserk77

    (@berserk77)

    yes Ajay BUT What i want to display is 4 “sets” of related posts each in a separate div container .
    So it will look like :

    Related Posts from custom Taxonomy1:
    --- CRP php code for Taxonomy1 goes here ---
    
    Related Posts from custom Taxonomy2:
    ---  CRP php code for Taxonomy2 goes here ---
    
    Related Posts from custom Taxonomy3:
    ---  CRP php code for Taxonomy3 goes here ---
    
    Related Posts from custom Taxonomy4:
    ---  CRP php code for Taxonomy4 goes here ---

    Currently the output of CRP plugin will display only “1 SET of Related Posts” which basically is the mixture of related posts queried based on what taxonomies i ticked in the CRP Settings [in this case 4 taxonomies ticked] .

    Plugin Author Ajay

    (@ajay)

    Ah. I get that now. Unfortunately, you won’t be able to do it directly with the plugin as it’s only one block per page.

    However, you should be able to do it by using the shortcodes (with post_types=”tax1″ as an argument) or editting your site template and using echo get_crp( array( 'post_types' => 'tax1' ) ) and so on for each block.

    Note that with this mode, the caching will fail as it only assumes a single block.

    Thread Starter berserk77

    (@berserk77)

    Hi Ajax,

    I tried the code echo get_crp( array( 'post_types' => 'tax1' ) ) replacing tax1 with Taxonomy1,Taxonomy2 & so on
    ALso tried shortcode method for each block but both method dont seem to work

    In settings have ticked infront of each option for the 4 taxonomies under “Fetch related posts only from”

    Recreated the index too for each of the below scenarios

    Now

    1] if both of the “Disable Contextual matching” option is enabled then all 4 div containers display the exact same related posts

    2] if both of the “Disable Contextual matching” option is disabled then all 4 div containers display “no related post found”

    Also abt the caching , do you think any caching plugin like W3 total cache/WP Super Cache will solve the caching issue ?

    • This reply was modified 7 years, 1 month ago by berserk77.
    Thread Starter berserk77

    (@berserk77)

    sorry for typo in name , Ajay , seems i cant edit it.
    Were u able to get the code to work ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘manual php for selective individual taxonomies using CRP Taxonomy Tools plugin ?’ is closed to new replies.