Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Content Views

    (@pt-guy)

    Firstly, you have to add that custom field to the fields array $dargs[‘fields’] via this filter
    $dargs = apply_filters( PT_CV_PREFIX_ . 'all_display_settings', $dargs );.

    Then, in includes/html.php, line 456:
    $html = apply_filters( PT_CV_PREFIX_ . 'field_item_html', $html, $field_name, $post );
    You have to add filter to get the output for that field.

    Finally, show that field in template file (e.g. templates/grid/html/main.php), by calling $fields_html['your_custom_filed_name']

    Hope this helps.

    Thread Starter phbo

    (@phbo)

    Thanks for the great explanation! Really good support.

    Hello.

    Can you tell me where you are doing the first bit?

    I’m not sure where I need to do this:

    $dargs = apply_filters( PT_CV_PREFIX_ . ‘all_display_settings’, $dargs );

    Thanks.

    Plugin Author Content Views

    (@pt-guy)

    Hi,
    You should add your custom filter to functions.php file in your theme.

    Hi PT Guy,

    Thank you for your quick response.

    I’ve not been able to locate the ‘html.php’. I can’t see an ‘includes’ directory. Is it the same as the ‘inc’ directory?

    Do I need to create the directory and or file if it’s not there?

    Sorry for the barrage of questions.

    Plugin Author Content Views

    (@pt-guy)

    Well, the /includes folder of plugin includes most core files.

    if you want to filter Content Views plugin, please add your code to functions.php file of your THEME.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to add custom field to view?’ is closed to new replies.