• Resolved cobra65

    (@cobra65)


    In /template-parts/content.php there is the statement:
    do_action( ‘neve_blog_post_template_part_content’, ‘single’ );

    Upon examination of /inc/views/template_parts.php it looks like the parameter ‘single’ (and by extension any parameter in the second position) is not used or even checked at all.

    Is this correct?

    If this is indeed the case, may I suggest a modification? Please pass that parameter to the get_article_inner_content function and add a hook, perhaps
    if (has_action(‘neve_get_article_inner_’ . $param2)) {
    add_action(‘neve_get_article_inner_’ . $param2);
    return;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cobra65

    (@cobra65)

    I see passing the second parameter is implemented in /inc/views/post_layout.php

    So the changes to /inc/views/template_parts.php would need to be:

    1a. public function render_post($context) {

    1b. ‘content’ => $this->get_article_inner_content($context),

    2a. private function get_article_inner_content($context) {

    2b. After $layout = $this->get_layout(); add this:

    if (has_action(‘neve_get_article_inner_’ . $context)) {
    ob_start();
    do_action(‘neve_get_article_inner_’ . $context,
    array($context,
    $layout,
    $this->get_title(),
    $this->get_post_thumbnail(),
    $this->get_meta(),
    $this->get_excerpt()
    )
    );
    $markup = ob_get_clean();
    return $markup;
    }

    I hope you will consider this feature request.

    Thanks much.

    Mat

    (@mateithemeisle)

    Hello @cobra65 ,

    Thank you for using Neve and apologies for the delayed reply!

    We have noted this code and forwarded it to our developers for further analyzing. If the code proves to be a good implementation, then our team will make sure to include it in future versions.

    Thank you for understanding and have an amazing day!

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

The topic ‘template-part parameter ignored?’ is closed to new replies.