• Resolved emilkaa

    (@emilkaa)


    Hopefully, the last question!

    Thank your for all your contributions. I have now settled in Ryu with some modifications, thanks to your helpful answers.

    I am now considering using the post-formats for my blog as I like the fact that you can click on the round icon and it works like a search. I would love to have that feature but I would like all my post-formats to behave like a standard post (in terms of appearance) but keeping the icon relevant to the post-format applied. Hope that makes some sense.

    Would there be an easy solution for this? I have no child theme, I used jetpack custom css for some changes to css and I have played with original .php codes for some further modifications (I know know… its just been easier for me this way round… )

    website: https://szmerkolandia.pl

Viewing 9 replies - 1 through 9 (of 9 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    About the only thing missing is the post title from the Aside, Links, Quotes and Video post types. What you would have to do would be to add the PHP to show the post titles in those page types. You would need to create a child theme and then copy the following files over to that child theme and then add in the

    content-aside.php
    content-links.php
    content-quotes.php
    content-video.php

    If you look in content.php you will see this

    <header class="entry-header">
    			<?php
    				$categories_list = get_the_category_list( __( ', ', 'ryu' ) );
    				if ( $categories_list && ryu_categorized_blog() )
    					echo '<span class="categories-links">' . $categories_list . '</span>';
    
    				if ( ! is_single() ) :
    					the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    				else :
    					the_title( '<h1 class="entry-title">', '</h1>' );
    				endif;
    			?>
    		</header><!-- .entry-header -->

    that you can use as a guide and you can actually do some copy/paste. This would be the relevant part.

    if ( ! is_single() ) :
    					the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    				else :
    					the_title( '<h1 class="entry-title">', '</h1>' );
    				endif;

    Here are some links to get you started with a child theme:
    Child Themes
    Child Theme creation plugins

    Thread Starter emilkaa

    (@emilkaa)

    this doesn’t work, things go weird with margins etc, i can’t figure it out! grhhh..

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Margins, positioning and such are CSS issues. You will have to create CSS rules to position and style the titles correctly.

    Can you post the php code you are trying to use here between “code” tags so we can take a look at it?

    Thread Starter emilkaa

    (@emilkaa)

    sacredpath, thanks but I think I gave up on it now
    I will revisit the issue in few weeks time I think because I could really do with the use of post-formats but I am too busy now to concentrate again on the blog

    but your help is greatly appreciated, I am sure I will come back to this topic!

    Thread Starter emilkaa

    (@emilkaa)

    sacredpath, ok, you got me thinking again.

    What I really need is image, quote, video, and would love to use another one as a substitute of ‘standard’ as you can’t filter on standard posts same way as you filter on other types.

    So.. I played with quote post yesterday and I managed to got this to look as standard! yeah! Thanks for the advice above, I did need to play with CSS a little bit.

    Here is how my content-quote.php looks like:

    <?php
    /**
     * @package Ryu
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<div class="entry-wrap wrap clear">
    			<header class="entry-header">
    			<?php
    				$categories_list = get_the_category_list( __( ', ', 'ryu' ) );
    				if ( $categories_list && ryu_categorized_blog() )
    					echo '<span class="categories-links">' . $categories_list . '</span>';
    
    				if ( ! is_single() ) :
    					the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    				else :
    					the_title( '<h1 class="entry-title">', '</h1>' );
    				endif;
    			?>
    		</header><!-- .entry-header -->
    		<footer class="entry-meta">
    			<?php ryu_entry_meta(); ?>
    
    			<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
    			<span class="comments-link"><?php comments_popup_link( __( 'Komentarze (0)', 'ryu' ), __( 'Komentarze (1)', 'ryu' ), __( 'Komentarze (%)', 'ryu' ) ); ?></span>
    			<?php endif; ?>
    
    			<span class="entry-format"><a href="<?php echo esc_url( get_post_format_link( 'quote' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'ryu' ), get_post_format_string( 'quote' ) ) ); ?>"><?php echo get_post_format_string( 'quote' ); ?></a></span>
    
    			<?php edit_post_link( __( 'Edytuj', 'ryu' ), '<span class="edit-link">', '</span>' ); ?>
    		</footer><!-- .entry-meta -->
    
    		<div class="entry-content clear">
    			<?php the_content( __( 'Czytaj dalej <span class="meta-nav">→</span>', 'ryu' ) ); ?>
    			<?php
    				wp_link_pages( array(
    					'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'ryu' ) . '</span>',
    					'after'       => '</div>',
    					'link_before' => '<span>',
    					'link_after'  => '</span>',
    				) );
    
    				?>
    		</div><!-- .entry-content -->
    
    		<a class="entry-format-badge theme-genericon" href="<?php echo esc_url( get_post_format_link( 'quote' ) ); ?>" title="<?php echo esc_attr( sprintf( __( '', 'ryu' ), get_post_format_string( 'quote' ) ) ); ?>"><span class="screen-reader-text"><?php echo get_post_format_string( 'quote' ); ?></span></a>
    	</div><!-- .entry-wrap -->
    </article><!-- #post-## -->

    and this is how it works:
    https://szmerkolandia.pl/?p=6896

    So, I was hoping I can do exactly the same and copy the same code into my content-image.php and it will work fine. So I did. But the result is this:
    https://szmerkolandia.pl/?p=6900

    Can you see how the image is displayed vs. quote post? And that little black icon is at the bottom of the post instead top right as with others?

    I looked at CSS and I couldnt identify what else is causing this issues, the relevant bit for post_format image in style.css is only this:

    /* Image */
    .format-image .entry-format-badge:before {
    	content: "\f102";
    }

    Where do I look next? Help!

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Ah, the image format doesn’t have a float. Add the following to your CSS and the alignment issue on the image format will correct.

    .format-image .entry-content {
        float: left;
    }

    Any chance you would let us know what you have changed in css and php to make video and image posts look like standard posts?

    Thank you!

    Moderator Kathryn Presner

    (@zoonini)

    vikou1008 – look like emilkaa has made their site private so you can’t look at their CSS right now.

    This is the simplest way to make the icons the same for all post format types:

    .entry-format-badge:before {
      content: "\f100" !important;
    }

    Don’t edit the theme files directly, otherwise your changes will be overwritten whenever the theme is updated.

    An easy way to add custom CSS is to install the Jetpack plugin and activate the Custom CSS module. You’ll then add your custom CSS in the new stylesheet editor that’ll appear in your dashboard, under Appearance > Edit CSS.

    As alternatives, you could either install a standalone custom CSS plugin, or create a child theme.

    If you’d like to make more changes beyond changing the icon, could you please start a new thread and provide a link to your site? Thanks!

    https://www.ads-software.com/support/theme/ryu#postform

    Thread Starter emilkaa

    (@emilkaa)

    vikou1008, apologies for not getting back to you.

    Yes, as my kids are getting older they insisted on the blog being only accessible by the password!

    I didn’t manage to make all posts look like standard. What I decided to do is not allocating post-formats at all (all posts remain standard) but I have used custom taxonomy and used it as format type, which offers me similar functionality without messing around with CSS, etc. Not sure if that’s of any help?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘all post-formats to look as standard post’ is closed to new replies.