Forum Replies Created

Viewing 15 replies - 91 through 105 (of 186 total)
  • Thread Starter caroline

    (@makeupedia)

    Thanks a lot!
    I had a look and found a onclick version here: http://koen.kivits.com/articles/pure-css-menu/

    Will use collapse-o-matic for other content now 🙂

    Thread Starter caroline

    (@makeupedia)

    Do you have gmail? It’s the same feature as they use for some of their buttons.
    Here’s a screenshoot of how the menu opens (top right)
    http://i.imgur.com/1pEOAb7.png

    Thread Starter caroline

    (@makeupedia)

    Yes I will! But for now I’ll skip custom fields and use it inside entries instead.

    But got one more question: How can I make the .collapseomatic_content overflow the content underneath?

    I found it too slow even with fast duration and this will probably speed it up a bit.

    Thread Starter caroline

    (@makeupedia)

    I solved this in this thread.

    Thread Starter caroline

    (@makeupedia)

    Solved!

    I had to copy this from parent template-tags.php into child functions.php.

    No idea why but seems like my child don’t read the parents template-tags.php.

    if ( ! function_exists( 'twentyfifteen_entry_meta' ) ) :
    /**
     * Prints HTML with meta information for the categories, tags.
     *
     * @since Twenty Fifteen 1.0
     */
    function twentyfifteen_entry_meta() {
    	if ( is_sticky() && is_home() && ! is_paged() ) {
    		printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen-child' ) );
    	}
    
    	$format = get_post_format();
    	if ( current_theme_supports( 'post-formats', $format ) ) {
    		printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
    			sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen-child' ) ),
    			esc_url( get_post_format_link( $format ) ),
    			get_post_format_string( $format )
    		);
    	}
    
    	if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
    		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
    
    		if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    			$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
    		}
    
    		$time_string = sprintf( $time_string,
    			esc_attr( get_the_date( 'c' ) ),
    			get_the_date(),
    			esc_attr( get_the_modified_date( 'c' ) ),
    			get_the_modified_date()
    		);
    
    		printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>',
    			_x( 'Posted on', 'Used before publish date.', 'twentyfifteen-child' ),
    			esc_url( get_permalink() ),
    			$time_string
    		);
    	}
    
    	if ( 'post' == get_post_type() ) {
    		if ( is_singular() || is_multi_author() ) {
    			printf( '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>',
    				_x( 'Author', 'Used before post author name.', 'twentyfifteen-child' ),
    				esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    				get_the_author()
    			);
    		}
    
    		$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) );
    		if ( $categories_list && twentyfifteen_categorized_blog() ) {
    			printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    				_x( 'Categories', 'Used before category names.', 'twentyfifteen' ),
    				$categories_list
    			);
    		}
    
    		$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen-child' ) );
    		if ( $tags_list ) {
    			printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    				_x( 'Tags', 'Used before tag names.', 'twentyfifteen-child' ),
    				$tags_list
    			);
    		}
    	}
    
    	if ( is_attachment() && wp_attachment_is_image() ) {
    		// Retrieve attachment metadata.
    		$metadata = wp_get_attachment_metadata();
    
    		printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>',
    			_x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen-child' ),
    			esc_url( wp_get_attachment_url() ),
    			$metadata['width'],
    			$metadata['height']
    		);
    	}
    
    	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    		echo '<span class="comments-link">';
    		comments_popup_link( __( 'Leave a comment', 'twentyfifteen-child' ), __( '1 Comment', 'twentyfifteen-child' ), __( '% Comments', 'twentyfifteen-child' ) );
    		echo '</span>';
    	}
    }
    endif;
    
    /**
     * Determine whether blog/site has more than one category.
     *
     * @since Twenty Fifteen 1.0
     *
     * @return bool True of there is more than one category, false otherwise.
     */
    function twentyfifteen_categorized_blog() {
    	if ( false === ( $all_the_cool_cats = get_transient( 'twentyfifteen_categories' ) ) ) {
    		// Create an array of all the categories that are attached to posts.
    		$all_the_cool_cats = get_categories( array(
    			'fields'     => 'ids',
    			'hide_empty' => 1,
    
    			// We only need to know if there is more than one category.
    			'number'     => 2,
    		) );
    
    		// Count the number of categories that are attached to the posts.
    		$all_the_cool_cats = count( $all_the_cool_cats );
    
    		set_transient( 'twentyfifteen_categories', $all_the_cool_cats );
    	}
    
    	if ( $all_the_cool_cats > 1 ) {
    		// This blog has more than 1 category so twentyfifteen_categorized_blog should return true.
    		return true;
    	} else {
    		// This blog has only 1 category so twentyfifteen_categorized_blog should return false.
    		return false;
    	}
    }
    Thread Starter caroline

    (@makeupedia)

    I understand and removed the childs template-tags.php, but still <?php twentyfifteen_entry_meta(); ?> gives error.

    Could it be that my child theme can’t reach the parent template-tags.php?

    I took the php entry-meta code from parent template-tag.php and put it in my childs functions.php. After that, the entry meta author and date showed up, but not the categories and tags which still gave error.

    Why it still won’t work when I rely on parents templates and have deleted my child ones is a mystery for me.

    Thread Starter caroline

    (@makeupedia)

    Thanks I will have a look!

    Thread Starter caroline

    (@makeupedia)

    Is this something I need to include in my childtheme, together with the other childtheme preferences?

    /**
     * Custom template tags for Twenty Fifteen
     *
     * Eventually, some of the functionality here could be replaced by core features.
     *
     * @package WordPress
     * @subpackage Twenty_Fifteen
     * @since Twenty Fifteen 1.0
     */

    I had to move code from parent template-tags.php to childs functions.php to make it work. But still experience error with this code:

    $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) );
    		if ( $categories_list && twentyfifteen_categorized_blog() ) {
    			printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    				_x( 'Categories', 'Used before category names.', 'twentyfifteen' ),
    				$categories_list
    			);
    		}

    So I will try figure it out now.

    Thread Starter caroline

    (@makeupedia)

    I managed to solve the author and date meta by reading this thread: https://wordpress.org/support/topic/display-only-parent-category-in-entry-meta

    However, the categories and tags aren’t visible yet and got some new errors:

    Fatal error: Call to undefined function twentyfifteen_categorized_blog() in /customers/6/8/1/makeupedia.se/httpd.www/wp-content/themes/twentyfifteen-child/functions.php on line 108

    Thread Starter caroline

    (@makeupedia)

    I also tried to deactivate all plugins, no luck.

    Thread Starter caroline

    (@makeupedia)

    I uploaded new copies of parent content.php and template-tags.php.

    Got this error:

    Fatal error: Call to undefined function twentyfifteen_post_thumbnail() in /customers/6/8/1/makeupedia.se/httpd.www/wp-content/themes/twentyfifteen-child/content.php on line 23

    Seems like I’ll have to switch all files and build a completely new child theme?

    Thread Starter caroline

    (@makeupedia)

    hi alchy,

    this is the message:

    Fatal error: Call to undefined function twentyfifteen_entry_meta() in /customers/6/8/1/makeupedia.se/httpd.www/wp-content/themes/twentyfifteen-child/content.php on line 99

    Thread Starter caroline

    (@makeupedia)

    The GCS creates 7 more search results divs, and I don’t have a clue why.

    Help is very much appreciated!

    Bump

    Thread Starter caroline

    (@makeupedia)

    Hi Tom,

    I managed to fix it earlier today 🙂 Not exactly as feelunique, but as I wanted it for now!

    Thanks!

Viewing 15 replies - 91 through 105 (of 186 total)