• Resolved sg2211

    (@sg2211)


    I am trying to get me head around the content-magazine.php. I would like a magazine layout but not the top large post.

    What part would I need to remove/change to remove the large top post?

    Excellent theme by the way!

    Many thanks.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi sg2211,
    Can you post url of your website, it would be easier to see and try to resolve issue
    Thanks
    Cheers
    TR

    Thread Starter sg2211

    (@sg2211)

    Thanks for your reply tahoerock.

    I would rather not post the URL but it the same as the Tuto demo: https://demo.mh-themes.com/tuto/.

    I would like to remove the first large post from the magazine layout. Here is the code for the magazine layout:

    <?php /* Template for displaying posts on posts page and archives */
    $counter = 1;
    $max_posts = $wp_query->post_count;
    while (have_posts()) : the_post();
    	if ($counter === 1) :
    		get_template_part('content', 'large');
    	endif;
    	if ($counter === 1 && $max_posts > 1) : ?>
    		<div class="mh-loop-grid mh-row clearfix"><?php
    	endif;
    	if ($counter > 1 && $counter <= 4) :
    		get_template_part('content', 'grid');
    	endif;
    	if ($counter === 5) : ?>
    		</div>
    		<div class="mh-loop-list clearfix"><?php
    	endif;
    	if ($counter >= 5) :
    		get_template_part('content');
    	endif;
    	if ($counter > 1 && $counter === $max_posts) : ?>
    		</div><?php
    	endif;
    $counter++;
    endwhile; ?>

    Many thanks.

    Hi SG,
    You do not need to tweak php code.
    You can accomplish same with css
    DO this:
    This are very important steps to do:
    put this code to your Child Theme style.css file
    OR
    Install Simple Custom CSS plugin and put the code there.
    If you do not do css this way and put the code to themes style.css, you will loose all changes you made when you update your theme in the future.
    I’m doing this on my browser to find solution.
    It can get to some different behaviour on your site.
    It can happen that ?it is not working.
    Then we have to look further.

    .mh-loop-content.mh-loop-large-content.clearfix {
        display: none;
    }
    figure.mh-loop-thumb.mh-loop-large-thumb {
        display: none;
    }
    
    or
    
    .mh-loop-content.mh-loop-large-content.clearfix {
        display: none!important;
    }
    
    figure.mh-loop-thumb.mh-loop-large-thumb {
        display: none!important;
    }

    Herer is a ScreenShot of the site how I did it on my site
    Hope this is what you are looking for.
    PIX

    Cheers
    TR

    • This reply was modified 8 years, 5 months ago by Tahoerock.
    • This reply was modified 8 years, 5 months ago by Tahoerock.
    • This reply was modified 8 years, 5 months ago by Tahoerock.

    Hi SG,
    If you want to do it PHP way, then you NEED to do this:

    You need to have ftp access to your site

    1.Create Child Theme
    2. Copy file content-magazine.php to your child theme
    3. Do the tweaking as described bellow
    4. Save the file

    Making LARGE post to small- delete large from code

    get_template_part('content', 'large');
    
    like this:
    
    get_template_part('content', '');

    Here is a file content-magazine.php how it looks like in your child theme:

    <?php /* Template for displaying posts on posts page and archives */
    $counter = 1;
    $max_posts = $wp_query->post_count;
    while (have_posts()) : the_post();
    	if ($counter === 1) :
    		get_template_part('content', '');
    	endif;
    	if ($counter === 1 && $max_posts > 1) : ?>
    		<div class="mh-loop-grid mh-row clearfix"><?php
    	endif;
    	if ($counter > 1 && $counter <= 4) :
    		get_template_part('content', 'grid');
    	endif;
    	if ($counter === 5) : ?>
    		</div>
    		<div class="mh-loop-list clearfix"><?php
    	endif;
    	if ($counter >= 5) :
    		get_template_part('content');
    	endif;
    	if ($counter > 1 && $counter === $max_posts) : ?>
    		</div><?php
    	endif;
    $counter++;
    endwhile; ?>

    Hiding the Large post from appearing

    You delete this from file:

    	if ($counter === 1) :
    		get_template_part('content', 'large');
    	endif;

    Here is a file content-magazine.php how it looks like in your child theme:

    <?php /* Template for displaying posts on posts page and archives */
    $counter = 1;
    $max_posts = $wp_query->post_count;
    while (have_posts()) : the_post();
    
    	if ($counter === 1 && $max_posts > 1) : ?>
    		<div class="mh-loop-grid mh-row clearfix"><?php
    	endif;
    	if ($counter > 1 && $counter <= 4) :
    		get_template_part('content', 'grid');
    	endif;
    	if ($counter === 5) : ?>
    		</div>
    		<div class="mh-loop-list clearfix"><?php
    	endif;
    	if ($counter >= 5) :
    		get_template_part('content');
    	endif;
    	if ($counter > 1 && $counter === $max_posts) : ?>
    		</div><?php
    	endif;
    $counter++;
    endwhile; ?>

    Hope this will help
    Cheers
    TR

    • This reply was modified 8 years, 5 months ago by Tahoerock.
    Thread Starter sg2211

    (@sg2211)

    @tahoerock Many thanks for your help with this.

    My pleasure to be on your site
    If you need any help
    Let me know.
    Cheers
    TR

    @tahoerock: Thanks for answering this request.

    ?? My pleasure.
    Cheers
    TR

    @tahoerock thank you, your answer helped me too.

    I have a question for you. I noticed you have a background image on the website you use TUTO theme. I really like that background with the blue color on the right, is it part of the demo only? I installed the theme but it doesn’t bring this background. Is there anywhere I can get it from?

    Thanks!

    @escliz: You can download the image from here.

    thank you so much!

    By the way I noticed that solution from @tahoerock for eliminating the top large post doesn’t entirely solve the problem. Yes, it does hide it, but that’s what it does, it hides it, meaning that every time you make a new post it doesn’t show up because it is hidden, and it is until you make a second new post that the previous one is shown but then the new one is hidden again.

    So I was wondering if there is a way to actually eliminate the top large post instead of hiding it? that way whenever we make a new post it will always show up.

    Thanks!

    @escliz: Please understand that this is a free theme (without customization services included) and in general the theme is supposed to work like it has been designed.

    In case you are familiar with coding, you may of course customize the theme to meet your personal requirements, for example by having a look at the counters in content-magazine.php and ensure that the first post still is included – which isn’t the case anymore if you simply delete:

    if ($counter === 1) :
        get_template_part('content', 'large');
    endif;

    Because that basically gets rid of the first post. You need to work with the counters and modify the layout to also ensure that the first post will be displayed as well.

    Or you could have a look at other themes and use the particular WordPress theme that exactly meets your needs and requirements. For custom development you could also try to hire a developer here: https://jobs.wordpress.net/

    I understand. Actually I like the large post and I have it included in my website. I was just bringing it up considering it only hides it and it doesn’t really solve the issue entirely. nevertheless the coding that @tahoerock provided is actually very good for anyone that desires to only hide it.

    Thank you for your help, I actually love this theme, it is my favorite and haven’t been able to find any other that I like more, not even premium ones. If you know a premious theme that is almost identical to this one please let me know ?? The one thing I wish this theme had, is that it would show the category name somewhere in the featured image on every post so that when people navigate through the website they immediately know which category the post belongs to without having to open the post. Would I need to hire a developer to do something like this? Or could simple coding do this?

    You’re welcome and we’re happy that you like the Tuto theme. Regarding premium WordPress themes, you could have a look at our popular MH Magazine theme. To see what is possible, you can have a look at various theme demos and several user sites.

    If you have any questions about the premium WordPress themes, please contact us because these forums here are for free themes only and we shouldn’t discuss premium stuff here. ??

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Remove large magazine post’ is closed to new replies.