Forum Replies Created

Viewing 10 replies - 31 through 40 (of 40 total)
  • You seem to have solved the font color problem in your child theme’s css.

    Check out bootswatchr.com. It lets you build a custom version of bootstrap with colors and fonts of your choice (among other things). This would greatly simplify your child theme’s style.css.

    Also, you seem to have something strange going on with this link in your page.

    ‘<link href=”http://withaspin.com/?custom-css=1&csblog=1&cscache=6&csrev=20&#8243; type=”text/css” rel=”stylesheet”>’

    When I inspect it with Firebug, this link seems to be duplicating and overwriting all the css in your child theme’s style.css. This seems to be related to Jetpack’s custom css feature (http://www.wpwp.org/forums/topic/conflict-with-jetpack-custom-css-plugin/). If you have a child theme, you can modify the child’s style.css (and do a lot of other things wordpress.com doesn’t allow), so you don’t need Jetpack’s custom css feature. So might want to turn off Jetpack’s custom css to avoid injecting a lot of duplicate content for people to download.

    Thought. Simple way to handle this would be to have a radio button option in customizer — use parent CSS/JS or use child CSS/JS. Based on that call the appropriate function in the_bootstrap_register_scripts_styles to set a variable, then use the variable instead of calling the get_template_directory_uri throughout the function. Note using child theme directory might create problems for bootswatch styles, but those of us using custom (and current, 2.2.2) bootstrap.css probably don’t care.

    If you don’t get to it sooner, I may try to tackle this in the next week or two and put it on git.

    I think what you want is in the_bootstrap_register_scripts_styles. The sequence of linked files here seems to match if I make allowances for plugins.

    See codex for get_template_directory_uri at http://codex.wordpress.org/Function_Reference/get_template_directory_uri which warns that the function gets the parent’s directory, not the child’s and gives an alternate function.

    But it would be nice if there was a way to set this in the theme customizer. If nothing else, you could point to a differently named bootstrap.min.css in the-bootstrap/css. Updating the parent shouldn’t overwrite it. (Should also be able to set the version in case people update bootstrap.css out of sync with the parent theme. And of course, all the bootstrap files should be included.)

    Take a look at theme-customizer.php in the-bootstrap/inc. It isn’t hard to add things here. You’d need to modify the function above to use the values you set. Once you have it working, submit it on git so Konstantin can pick it up.

    Check out http://wordpress.org/support/topic/removing-the-excerpt-continue-reading-link?replies=8

    The goal there was to remove the link, but you can modify the last echo in function the_excerpt_max_charlength($charlength) in my last post there to spit out a permalink with whatever you want it to say. If you don’t care about the other excerpt functionality, you can strip that down to whatever you need.

    As I was experimenting last night, I found that get_the_excerpt will attempt to put the link in (even if I remove filter), and if the excerpt is short, that can mess up the HTML. I modified an example function from codex to grab the post’s excerpt text directly rather than use functions. If there is no excerpt, grab the first chunk of the article with a little extra. Then whack it down to the desired length, always terminating on a whole word.

    function the_excerpt_max_charlength($charlength) {
    	$post = get_post();
    	$excerpt = $post->post_excerpt;
    	$charlength++;
    
    	if (mb_strlen($excerpt) == 0) $excerpt = mb_substr($post->post_content, 0, $charlength + 5);
    
    	if ( mb_strlen( $excerpt ) > $charlength ) {
    		$subex = mb_substr( $excerpt, 0, $charlength - 5);
    		$exwords = explode( ' ', $subex );
    		$excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) );
    		if ( $excut < 0 ) {
    			echo mb_substr( $subex, 0, $excut );
    		} else {
    			echo $subex;
    		}
    	} else {
    		echo $excerpt;
    	}
    	echo ' [. . .]';
    }

    Yep. It’s definitely my child theme (looks very different from Bootstrap default). I guess one question might be: how should I be pulling the excerpt? I’m using the_excerpt() because that’s what’s in the default partials/content.php. Should I be using one of the other excerpt options?

    So, I’m trying to remove the Continue Reading link too. I put this in my child theme’s functions.php and I’m still getting a Continue Reading link. Did I miss something here? Thanks.

    function remove_excerpt_more_link() {
    	remove_filter( 'get_the_excerpt', 'the_bootstrap_custom_excerpt_more' );
    	remove_filter( 'excerpt_more', 'the_bootstrap_auto_excerpt_more' );
    }
    
    add_action( 'after_setup_theme', 'remove_excerpt_more_link' );

    I found it in functions.php in the_bootstrap_print_styles().

    Note that, if you have a floating top navbar (which you do if this is in your HTML) and don’t have an override in your child theme’s styles.css, this will cause the top edge of the main content area to float up under the navbar, which might hide part of any header.

    If you just want to eliminate the space between the top of the content area and the navbar, you’ll need to adjust the margin values. FWIW, I did that in my child theme’s styles.css with values 51 and 41.

    A bit confused here. In the-bootstrap’s Customize section, you can set the site title and tag text. These do affect the site.

    The colors are set by the bootstrap css. You can customize colors, etc. at the bootstrap git here or use bootswatch or a site like this.

    The site title in the header is a link, so inherits it’s color from the a element. So you could change the default link color using one of the sites above. If you only want to change the site title link’s color, you should be able to style #site-title in a child theme.

    The site title in the navbar is set by .navbar.brand. Again, you should be able to customize this in a child theme if you wanted.

    But note that if you only change the title’s color, you’re breaking the site’s consistency, which is what bootstrap tries to drive.

    Another useful link for certain settings. Useful for experimenting with colors to plug into the Twitter customize page.

    http://stylebootstrap.info/

Viewing 10 replies - 31 through 40 (of 40 total)