Title: PHP Issue
Last modified: August 31, 2016

---

# PHP Issue

 *  Resolved [rafael666](https://wordpress.org/support/users/rafael666/)
 * (@rafael666)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/)
 * Thanks for this great plugin !
 * Is there a version php for the display. I don’t want to use shortcode but a php
   implementation directly on a template file with a test.
    Exemple : if($CustomRelatedPosts){//
   instructions; }
 * It would be supernatural !
    Thanks !
 * [https://wordpress.org/plugins/custom-related-posts/](https://wordpress.org/plugins/custom-related-posts/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098714)
 * What is it you’re trying to achieve exactly?
    It’s possible to execute shortcodes
   in PHP by doing something like:
 * `<?php echo do_shortcode( '[custom-related-posts]' ); ?>`
 * Does that help for what you want to do?
 *  Thread Starter [rafael666](https://wordpress.org/support/users/rafael666/)
 * (@rafael666)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098759)
 * Hello !
 * Thanks for the quick answer (and apologize for my poor english) !
 * I want try to make a condition. If 0 Related Posts, don’t show anything (actually,
   the shortcode display always “Related Posts” “None found” if any related posts).
 * I tried to find the good portion of code (the php translation of shortcode) but,
   arghhhh, I haven’t found…
 * Have a nice day !
    RaF
 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098761)
 * There are actually a few parameters you can add to the shortcode. One of those
   is the text to show when there are no related posts shown. Try this one:
 * `[custom-related-posts none_text=""]`
 *  Thread Starter [rafael666](https://wordpress.org/support/users/rafael666/)
 * (@rafael666)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098764)
 * Yes but no 🙂 I want to hide all the block (“Related Posts” too).
 * This parameter is just for change the text. I search a solution with Manuel Related
   Posts (in admin, your plugin is what i search) but with more flexibility for 
   the display and integration in php templates files (hide the complete block if
   any related post…)…
 * Thanks for this exchange !
    Have a nice day ! RaF
 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098789)
 * If you use [custom-related-posts none_text=””] it should not show anything at
   all, actually.
 *  Thread Starter [rafael666](https://wordpress.org/support/users/rafael666/)
 * (@rafael666)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098792)
 * In this case, “none found” is not displaying but the title RELATED POST is showing!
 * RaF
 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098830)
 * What’s the exact shortcode you’re using? I tested it again, just to be sure, 
   and when I use this nothing shows up when there are no related posts:
    `[custom-
   related-posts title="Related Posts" order_by="title" order="ASC" none_text=""]`
 * You are using version 1.2, right?
 *  Thread Starter [rafael666](https://wordpress.org/support/users/rafael666/)
 * (@rafael666)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098849)
 * My apologies !
    This morning, I reinstalled your plug-in, re-activate him, made
   another try and the block and title Related Post isn’t display anymore when there
   are no related posts. I don’t know why yesterday the display of the title was
   always visible !
 * Very easy to custom with CSS, it’s very great !
    Thank you so much for your patience!
   rafael
 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098861)
 * Good to hear it’s working now!
    Just let me know if you have any other questions
   or suggestions.
 * Brecht

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP Issue’ is closed to new replies.

 * ![](https://ps.w.org/custom-related-posts/assets/icon-256x256.png?rev=2007814)
 * [Custom Related Posts](https://wordpress.org/plugins/custom-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-related-posts/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Brecht](https://wordpress.org/support/users/brechtvds/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/php-issue-10/#post-7098861)
 * Status: resolved