• I have been trying to use the add_filter(‘ymc_post_custom_layout_476_1’, ‘my_custom_post_layout’, 10, 5) with absolutely no success. I am not sure if this needs to be wrapped in another function, if I am entering it in the wrong place or if I should be entering other parameters. Please provide some guidance on the use of custom templates with the plugin.

    This is the code I am currently using.

    function my_custom_post_layout($layout, $post_id, $filter_id, $increment_post, $arrOptions) {
    $layout = get_the_title($post_id). ‘gertretretert’;
    $layout .= wp_trim_words(get_the_content($post_id), 30);
    $layout .= ‘Read More’;
    // $layout .= ‘Open Popup‘;
    return $layout;
    }
    add_filter(‘ymc_post_custom_layout_476_1’, ‘my_custom_post_layout’, 10, 5);

    I entered it into the custom actions field in the advanced section go the plugin settings. Thank you for your assistance on this matter.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author YMC

    (@wssoffice21)

    Hi

    You should paste this code into your website theme file called functions.php
    this is the first thing. Then, you should check the filter ID and filter counter. Send us a link to the page of your website where you use the filter and we can help you.

    check in this filter add_filter(‘ymc_post_custom_layout_476_1’, ‘my_custom_post_layout’, 10, 5);
    filter ID – 476 and counter – 1

    • This reply was modified 11 months, 3 weeks ago by YMC.
    • This reply was modified 11 months, 3 weeks ago by YMC.
    • This reply was modified 11 months, 3 weeks ago by YMC.
    Thread Starter prof-anonymous

    (@kiano)

    Based on your reply, I have added this code to my functions.php file.

    function my_custom_post_layout($layout, $post_id, $filter_id, $increment_post, $arrOptions) {
    $layout = get_the_title($post_id). ‘gertretretert’;
    $layout .= wp_trim_words(get_the_content($post_id), 30);
    $layout .= ‘Read More’;
    // $layout .= ‘Open Popup‘;
    return $layout;
    }

    In the Advanced section of the settings for this plugin, I added the following code to the custom actions field.

    add_filter(‘ymc_post_custom_layout_476_1’, ‘my_custom_post_layout’, 10, 5);

    Below is the message I am still seeing on each post card in the filter and grid.

    Use a filter:ymc_post_custom_layout_476
    ymc_post_custom_layout_476_1to override post template.
    Example:add_filter(“ymc_post_custom_layout_476_1”, “callback_function”, 10, 5);See documentation.

    Thank you for your continued assistance.

    Plugin Author YMC

    (@wssoffice21)

    select custom layout in plugin settings

    https://prnt.sc/XFDSCDpUnZ4V

    Thread Starter prof-anonymous

    (@kiano)

    Added all the code to the fnctions.php fule and it is currently working. Thank you for your assistance.

    Plugin Author YMC

    (@wssoffice21)

    Good Luck!

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

The topic ‘Custom Layout not working’ is closed to new replies.