Support » Theme: Maxwell » Missing function in “content-page.php” – maxwell_post_image_page()

  • Resolved camya

    (@ecc)


    I found a missing implementation problem in the “template-parts” for content. In content.php, content-single.php, and content-slider.php, you use the maxwell_*() functions, which could be easily overwritten in the child theme.

    <?php maxwell_post_image_single(); ?>
    <?php maxwell_post_image_archives(); ?>
    <?php maxwell_slider_image(); ?>

    Thats awesome, because I need to add the image just above “the_content” in order to float it right. It’s easy to implement this. Love it so far. 🙂

    Problem: Unfortunately you use the WordPress stock function the_post_thumbnail() in “template-parts\content-page.php”

    <?php the_post_thumbnail(); ?>

    Because of this, I can’t move the image from the article header to the content area. 🙁

    Suggesion:

    Please implement a maxwell_*() function to load the thumbnail in “template-parts/content-page.php” to.

    <?php maxwell_post_image_page(); ?>

    Cheers,
    Andreas

    • This topic was modified 2 months, 2 weeks ago by camya.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author ThemeZee

    (@themezee)

    Hi Andreas,

    Thanks so much for using Maxwell.

    I would argue that the function is not really missing. Adding our own maxwell_*() functions for displaying featured images has the reason that there are either theme options or image links to consider.

    For the featured image on static pages there is no further logic, so adding a custom function in the theme would just be an empty wrapper. Yes, I can see why this could make sense, but decided against.

    You can still modificate the theme as you wish, by overriding the content-page.php template file. I do not see the point what an empty wrapper function improves when you want to change the position of the image.

    Cheers,
    Thomas

    Hi Thomas,

    nice to meet you and thank you for your explanation. In the meantime we launched our project, and your theme is really great. 🙂

    If you don’t implement my request, I’m absolute fine with it.

    Following just as an additional explanation.

    I overwrite the function maxwell_post_image_single() {} to hide the image from its default position completely, because this image is added just before the <header class="entry-header"> in the template by default.

    On my website, I needed the image inside the <div class="entry-content clearfix"> just above the_content().

    So I hide the image with maxwell_post_image_single() and pre-pend it in add_action(‘the_content’) above the post content.

    I implemented this for the post with success.

    Unfortunately it’s not possible to hide the image using the stock the_post_thumbnail() function using any available action or filter. So a function maxwell_page_image() is really needed here to accomplish the above requirements.

    So pages on our site still use the default image position above the header, but I’m fine with this. 😉

    Have a nice day and greetings from Hamburg,
    Andreas

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.