Closed johocen168 closed 10 months ago
Hello! You will need to use a filter ID called 51502-1 Thus the name of the filter will be as follows: add_filter('ymc_post_custom_layout_51502_1', 'my_custom_post_layout', 10, 5); We hope this helps you.
Sorry for late response, I was away from home.
I was confused, the short code is [ymc_filter id='51502']
I used the plugin "Snippet" to add the code as following, but didn't work, how can I make it right?
function my_custom_post_layout($layout, $post_id=51446, $filter_id=51502_1, $increment_post, $arrOptions) { $layout = '<h2>'.get_the_title($post_id=51446).'</h2>'; $layout .= '<p>'.wp_trim_words(get_the_content($post_id=51446), 30).'</p>'; $layout .= '<a href="'.get_the_permalink($post_id=51446).'">Read333More</a>'; // $layout .= '<a class="'.esc_attr($arrOptions['class_popup']).'" data-postid="'.esc_attr($post_id).'" href="#">Open Popup</a>'; return $layout; } add_filter('ymc_post_custom_layout_51502_1', 'my_custom_post_layout', 10, 5);
Thanks for the nice plugin, it is easy to use and exactly what we need. but it's a pitty that can not change the color and text of post button easily.
copied the code you provided in "Example Custom Post Layout" but it seems every post has a different id number, please see the screenshot and help me with the code, thanks
function my_custom_post_layout($layout, $post_id, $filter_id, $increment_post, $arrOptions) {
$layout = '
'.get_the_title($post_id).'
'; $layout .= ''.wp_trim_words(get_the_content($post_id), 30).'
'; $layout .= 'Read More'; // $layout .= 'Open Popup';return $layout; } add_filter('ymc_post_custom_layout_545_1', 'my_custom_post_layout', 10, 5);