• Resolved gtaranti

    (@gtaranti)


    Is it possible to use the post_date and post categories in a custom template (i.e. by cloning the simple.php recipe template) ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    Sure, it’s possible to create a custom template by following these instructions:
    https://bootstrapped.ventures/wp-recipe-maker/create-your-own-template/

    Thread Starter gtaranti

    (@gtaranti)

    Hi,
    Thank you for the fast reply!

    I want to add a function to class-wprm-recipe.php in order to get the post categories ( like $recipe->categories ), but I don’t want to change the plugin code.
    Should I add it to my child theme functions.php or do I have to replicate some of the plugin’s code structure.

    Plugin Author Brecht

    (@brechtvds)

    Is there a reason for it needing to be a part of the recipe object?

    Brecht

    Thread Starter gtaranti

    (@gtaranti)

    My reason is that I have already in place an architecture where the categories have assigned to the parent post, not the recipe itself (like cousine)

    Anyway, I think I can use something like

    $category_detail=get_the_category($recipe->parent_post_id());
    foreach($category_detail as $cd){
    echo $cd->cat_name . ' - ';
    }

    inside the template php file.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use of post date and categories’ is closed to new replies.