Home Forums Modern Modern's Huge Upgrade Renders my Child-Themed Site Unusable

Viewing 5 posts - 11 through 15 (of 15 total)
  • Author
    Posts
  • #17282

    Oliver Juhas
    Keymaster

    Hi hiraag,

    1. No need to override a whole file here. Like I’ve mentioned previously, use filter hook and pass your custom function in it where you check for front page.
      function child_theme_intro_disable( $disable ) {
        if ( ! is_front_page() ) {
          $disable = true;
        }
        return $disable;
      }
      add_filter( 'wmhook_modern_intro_disable', 'child_theme_intro_disable' );
    2. Please use wmhook_modern_loop_query filter hook to modify the query. There is a file name passed as $context argument for the filter, so you will be able to pinpoint your modification for that specific loop. Something like this:
      function child_theme_loop_front_blog( $query, $context ) {
        if ( 'loop-front-blog.php' == $context ) {
          // Modify the $query here.
        }
        return $query;
      }
      add_filter( 'wmhook_modern_loop_query', 'child_theme_loop_front_blog', 10, 2 );

      Please read information about using WordPress hooks. If you are not familiar with advanced WordPress coding, please consider hiring some help to assist you with your website modifications.

    3. As you can see in theme demo website, the theme correctly display post featured image on blog page (in posts list view, the first 2 posts are standard post format with featured image set, for example). You can also read theme documentation about how post formats are displayed. Maybe you are using some custom CSS to hide the image on your website? Use your browser’s code inspector to check whether it’s so, or check your custom styles code.

      If you want to make the image 100% width of the container, set the correct image sizes in your WordPress admin or/and use custom CSS to stretch the image width (.entry-media img { width: 100%; }).

    Best regards,

    Oliver Juhas
    WebMan Design

    #17316

    hiraag
    Participant

    Hi Oliver,

    The hooks you provided in #1&2 above allowed me to free myself of any custom override of Modern’s own files. I can’t thank you enough! Side question: Is there a documentation of Modern’s hooks somewhere? Not that you have any obligation to provide that sort of thing.

    I was not able to find why the images were not showing in card views for standard format posts. I feel like I disappointed you on that, but I could not find any possible reason. The container div with class of entry-media is not printed on card – so it isn’t any css doing it. (child style.css has nothing like that anyway)

    I decided to use the following hook action in my functions.com as a non-elegant stop gap solution for now. It seems to work without breaking anything else.

    add_action( 'tha_entry_content_before','hh_entry_content_before' );
     function hh_entry_content_before(){
     	if ( has_post_thumbnail() ){ the_post_thumbnail(); }
     }

    You are truly helpful and I owe you donation when my situation gets better financially. Huge thanks!

    • This reply was modified 1 month, 1 week ago by  Oliver Juhas. Reason: Formatting code
    #17319

    Oliver Juhas
    Keymaster

    Hi hiraag,

    I’m glad the solution worked :)

    First, please don’t feel like you disappointed me! That’s simply not true and I only provide you with help and tips, there is no requirement from me, or any pressure or any obligation. I apologize if I express myself that way!

    I’m sorry, but there is no documentation on what hooks the theme provides. But it is very ease to get the full list of hooks, actually. You can simply search the theme files for do_action( and apply_filters( in your code editor (such as Sublime Text). As stated in theme documentation, the theme supports complete set of Theme Hook Alliance action hooks, so you get a good start there. For instructions on how to use hooks simply refer to WordPress documentation as it is a WordPress native functionality.

    As for your image issue, please, also check your Appearance → Customize → Content Options and make sure you are not disabling featured image there. If the issue persist, please provide URL to your website so I can check personally.

    Best regards,

    Oliver Juhas
    WebMan Design

    #17344

    hiraag
    Participant

    Hi Oliver,

    You are absolutely correct again. The three checkbox preferences in Featured Images section of Appearance → Customize → Content Options that you provides for flexibility did the trick.

    I had nonchalantly checked off all the boxes there when in fact what matches my actual preference is as follows: Display on blog and archives=Yes, Display on single posts=Yes, Display on pages=No. I removed the hook that I mentioned above.

    You are a consummate professional not only for putting our great product, but also for how helpful you make yourself. At this point all my issues are resolved and I know I owe you!

    #17346

    Oliver Juhas
    Keymaster

    Hi hiraag,

    I’m glad you were able to solve the issue and port your website to new, updated theme version. I promise, there will be no more huge theme updates in the future – at least not anytime soon ;)

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 5 posts - 11 through 15 (of 15 total)

You must be logged in to reply to this topic.