michaelgof
Forum Replies Created
-
-Awesome. works great.
-I think i have no choice than study basic html and css to make sense of some of this.
-Will sent a few bucks your few for the support. Awesome theme. How do i do that?
– i want the updated date. let me try the second and see what it gives
– I wanted the author picture and the date to appear below the title so i introduced a function i got from the forums. Here is the function
add_filter( 'generate_post_author', '__return_false' ); add_filter( 'generate_show_comments', '__return_false' ); add_filter( 'generate_post_date_output', 'tu_fancy_byline', 10, 2 ); function tu_fancy_byline( $date, $time_string ) { printf( ' <span class="byline">%1$s</span>', sprintf( '<span class="author vcard" itemtype="https://schema.org/Person" itemscope="itemscope" itemprop="author">%4$s<span class="author-name" itemprop="name">%3$s</span></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ), esc_html( get_the_author() ), get_avatar( get_the_author_meta( 'ID' ) ) ) ); echo $time_string; }
-Ok i get it.
– I sent details of login for date issue and this thread through https://generatepress.com/contact/
-Please check it out.
Forum: Themes and Templates
In reply to: [GeneratePress] How to customize the scroll to top buttonPerfect! that did the job. I just had to edit a few parameters.
– Now is there a way to dynamically set image dimensions to a specified content width?
In other ways i want images to fit to specific content [container] width based on various screen sizes.
– For example, this is an image of the website am constructing on a mobile. [Same applies to tablets]
– On close observation you see the image is centered. Its ok on desktop. But for tablets and mobile screens i want the image to stretch out a little bit and occupy the white spaces left and right.
– Well it should be dynamic based on the tablet or mobile screen
– I could set some image parameter so that the image occupies a certain percentage of the container width.
– At least you get what am trying to say. Is there a way a can achieve that? ??
-Awesome works perfect ??
Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into Buttons-Yes its the function you provided. i disabled the cache plugin
-Here is what i see
Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into Buttons– I tried your code *This as your full function should do that:*
-It actually makes the author and date links unclickable??
-But it duplicates the date with no spacing and the “last updated” text vanishes
Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into Buttons-Here is what i got in the child functions.php
<?php
/**
* GeneratePress child theme functions and definitions.
*
* Add your custom PHP in this file.
* Only edit this file if you have direct access to it on your server (to fix errors if they happen).
*/function generatepress_child_enqueue_scripts() {
if ( is_rtl() ) {
wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
}
}
add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );if (defined('WPSEO_VERSION')) {
add_action('wp_head',function() { ob_start(function($o) {
return preg_replace('/^\n?<!--.*?[Y]oast.*?-->\n?$/mi','',$o);
}); },~PHP_INT_MAX);
}/*my own code - this code shows the round author head, number of comments, date below post title */
add_filter( 'generate_post_author', '__return_false' );
add_filter( 'generate_show_comments', '__return_false' );
add_filter( 'generate_post_date_output', 'tu_fancy_byline' );
function tu_fancy_byline( $date ) {
printf( ' <span class="byline">%1$s</span>',
sprintf( '<span class="author vcard" itemtype="https://schema.org/Person" itemscope="itemscope" itemprop="author">%4$s<span class="author-name" itemprop="name">%3$s</span></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
esc_html( get_the_author() ),
get_avatar( get_the_author_meta( 'ID' ) )
)
);/*if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) );
echo '</span>';
}*/echo $date;
}/* position category links on featured image */
add_filter( 'generate_show_categories', '__return_false' );add_action( 'generate_after_entry_header', function() {
$categories_list = get_the_category_list( '' );if ( $categories_list ) {
echo '<div class="category-container">' . $categories_list . '</div>';
}
}, 20, 20 );/* For styled comment count below reab more link */
add_filter( 'generate_show_comments', '__return_false' );add_action( 'generate_after_content', function() {
if ( is_singular() ) {
return;
}echo '<div class="comments-link">';
comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) );
echo '</div>';
} );What do you suggest i edit?
Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into ButtonsPerfect??
– Now hovering over the author and date shows they are links. How do i stop that behavior?
– It should just be the text and not clickable.
Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into Buttonsand here is the css for that
.byline img {
width: 25px;
height: 25px;
border-radius: 50%;
position: relative;
vertical-align: middle;
margin: 0 10px 0 0;
}.byline,
.comments-link,
.posted-on {
display: inline-block;
}.comments-link,
.posted-on {
border-left: 1px solid #ddd;
padding-left: 10px;
margin-left: 10px;
}.comments-link:before {
display: none;
}Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into Buttons-i don’t want the comment count at the top. but its looking great already
-here is the function
add_filter( ‘generate_post_author’, ‘__return_false’ );
add_filter( ‘generate_show_comments’, ‘__return_false’ );
add_filter( ‘generate_post_date_output’, ‘tu_fancy_byline’ );
function tu_fancy_byline( $date ) {
printf( ‘ <span class=”byline”>%1$s</span>’,
sprintf( ‘<span class=”author vcard” itemtype=”https://schema.org/Person” itemscope=”itemscope” itemprop=”author”>%4$s<span class=”author-name” itemprop=”name”>%3$s</span></span>’,
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
esc_attr( sprintf( __( ‘View all posts by %s’, ‘generatepress’ ), get_the_author() ) ),
esc_html( get_the_author() ),
get_avatar( get_the_author_meta( ‘ID’ ) )
)
);if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo ‘<span class=”comments-link”>’;
comments_popup_link( __( ‘Leave a comment’, ‘generatepress’ ), __( ‘1 Comment’, ‘generatepress’ ), __( ‘% Comments’, ‘generatepress’ ) );
echo ‘</span>’;
}echo $date;
}Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into Buttonsi added the above code. see it here
– i think the problem may be at the start of the child functions.php file
– There’s code there that also controls the comment count beside the author head and the published date
-May be you can login and check it out.
– Am trying ti achieve the exact card here
- This reply was modified 6 years, 4 months ago by michaelgof.
Forum: Themes and Templates
In reply to: [GeneratePress] How to Style the Category Links into Buttons-We are getting there check it out
-But the mobile friendliness in not there when the window is reduced to mobile size
-It looks like this will be complicated to setup so i decided to keep things simple.
-I just want to replicate the card like here that is putting the comments count(styled) below the read more button.??