dev_John
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Related Posts] Display the date and category of the postOh, sorry! Yes, It’s great!
Thanks a lot for your help!Forum: Plugins
In reply to: [Custom Related Posts] Display the date and category of the postI added the code you wrote to the theme’s functions.php file. And commented out my code in the plugin file (/helpers/output.php).
This does not work, the category and date fields are no longer displayed on the page.Forum: Plugins
In reply to: [Custom Related Posts] Display the date and category of the postIf I add this code to my theme functions.php file:
function crp_output_list_item( $output, $post_id ) { // Some code } add_filter( 'crp_output_list_item', 'crp_output_list_item', 10, 2 );
Will this code COMPLETELY replace the whole/entire function (function output_relation( $relation ) in /helpers/output.php) of your plugin?
Thanks!
Forum: Plugins
In reply to: [Custom Related Posts] Display the date and category of the postHi @brechtvds
I added this code to your plugin file (/helpers/output.php). And it works the way I wanted!
Here are the changes (added lines “Customization”):$output .= '<div class="crp-list-item-title"><a href="' . $relation['permalink'] . '"' . $link_target . '>'; $output .= $relation['title']; $output .= '</a></div>'; /********** Customization **********/ $relateddate = get_the_date( 'F j, Y', $relation['id'] ); $relatedcat = get_the_category( $relation['id'] ); $output .= '<div class="p-crp-list-item-date">' . $relateddate . '</div>'; $output .= '<div class="p-crp-list-item-category">In "' . $relatedcat[0]->cat_name . '"</div>'; /********** ********** **********/ if ( in_array( CustomRelatedPosts::setting( 'template_image' ), array( 'below', 'right' ) ) ) { $output .= $image; }
But I don’t know how to add this using a “crp_output_list_item” hook to avoid making changes directly to the plugin file (use a theme functions.php file instead), because every time I update the plugin I’ll have to add this code again.
Thanks!
- This reply was modified 5 years, 4 months ago by dev_John.
Forum: Plugins
In reply to: [Custom Related Posts] Display the date and category of the post@brechtvds
Thanks for the quick response!Forum: Plugins
In reply to: [Bold Page Builder] PHP Notice after plugin updateNow everything is fine! Thank you so much!
This can not be used?
https://github.com/woocommerce/woocommerce-gateway-stripe/tree/4.0.0Thank You!
Can I personally try to use the 4.0.0 version of the plugin. Taking her from GitHub?