Forum Replies Created

Viewing 15 replies - 91 through 105 (of 215 total)
  • Theme Author Tim Nicholson

    (@timnicholson)

    Hi, Diana. I see you changed up your home page. I’m not sure if you specifically wanted it to look and work that way or if you set that up temporarily until you could get the standard WordPress home page looking the way you want. So I’m a little confused on what direction to give here.

    I think what you may want is something that I’ve been thinking of building as perhaps my next theme. It would have a large image in the header, but the navbar would be transparent so that the links looks like they are just sitting on top of the image. Then either the navbar scrolls away like a traditional web page or perhaps the navbar gets a semi-transparent effect added to it. Then in the footer, it could display the bottom part of the header image and have the footer menu and site credits also have a transparent background to let the image show through.

    Is that similar to what you are wanting to do or are you really wanting non-scrolling, fixed background image with the header and footer menu / site credits having a transparent background?

    Theme Author Tim Nicholson

    (@timnicholson)

    Hi, You would need to add that CSS to the style.css file or use the Jetpack Custom CSS module and add it there. If this is the only change you are making and you just want to “hard-code” that style right in the php file, you’d apply an inline style like this:

    // Site title (Bootstrap "brand") in navbar. Shown by default. Customizer will
    // let you hide it if you want.
    $navbar .= '<a class="navbar-brand" href="'
    		.esc_url( home_url( '/' ) )
    		.'" rel="home" style="padding-top: 9px; padding-bottom: 9px;">'
    		.'<img width="155" height="50" alt="CandTConstruction" src="http://candtconstruction.com/wp-content/themes/pratt/images/logo-50.gif">'
    		.'</a>';

    Theme Author Tim Nicholson

    (@timnicholson)

    Something like this should work if you name this file content-video.php:

    <?php
    /**
     * File: content-video.php
     * Theme: Flat Bootstrap
     *
     * The template used for displaying video posts.
     *
     * @package flat-bootstrap
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<?php // Display the post title and header meta ?>
    	<?php get_template_part( 'content', 'post-header' ); ?>
    
    	<?php // For video posts, display the full content ?>
    		<div class="entry-content">
    
    		<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'flat-bootstrap' ) ); ?>
    
    		<hr>
    	</div><!-- .entry-content -->
    
    </article><!-- #post-## -->

    This will display the full post, including the video itself, on your blog… whether the blog is your front page or you have a static front page and a separate blog page.

    Note that if you intend to ever use the page-fullwithposts.php page template, that still won’t display the video, but it doesn’t sound like you are using that one.

    Theme Author Tim Nicholson

    (@timnicholson)

    Yes, although I don’t think you’ll need to do that with every single update to the Link theme unless you need whatever enhancement or fix is in a new version. One thing that may help you is to look at my github page for the Link theme. From there, you can see exactly what has changed from version to version and just apply the updates you need or just copy in the changed files only. Link Theme on Github

    Theme Author Tim Nicholson

    (@timnicholson)

    Is this working now for you? The static home page shouldn’t be displaying “home” on it. I’ve got v1.5 ready to upload and I know that one works, but it should already be fixed in the current v1.4.4.

    Theme Author Tim Nicholson

    (@timnicholson)

    In general, its really hard to align things in the center vertically with CSS. For example, here is a lengthy discussion about it: Stack Overflow

    However, since I assume you have a hard-coded image size, can’t you just adjust the top and bottom padding? The navbar is 50px high. The .navbar-brand, which is where the original text and now your image is contained, has has 14px top and bottom padding because the font-size is 22px.

    If your image is let’s say 32px high, then you could add this css:
    .navbar-brand { padding-top: 9px; padding-bottom: 9px; }

    Theme Author Tim Nicholson

    (@timnicholson)

    The way to do it is the same for all my themes. You can see how to do it here: Change Footer Credits.

    I may consider putting a span class around the copyright section and one around the “theme by” section so that it can be done with CSS, but for now you have to edit php code.

    Theme Author Tim Nicholson

    (@timnicholson)

    I’ve not heard of anyone having problems putting widgets into the sidebar. If you haven’t added any widgets, then default ones are displayed, which are search, pages, and a category cloud. Do you see those?

    Can you add widgets to the other widget areas, like the footer, page top, and/or page bottom?

    Can you send a link to your site showing one of your pages that should have widgets on it?

    Theme Author Tim Nicholson

    (@timnicholson)

    I have looked into this and AFAICT themes that display video content are not displaying the full excerpt for video posts but rather displaying the full article. In other words, they are checking the post type and if its a video post they are displaying the_content() instead of the_excerpt().

    If you make a child theme, you can turn on a special post type of “video”, by inserting this in the top of the child theme’s functions.php file:

    $xsbf_theme_options = array(
    	'post_formats' 			=> array( 'video' )
    );

    Then you’d copy down the content.php file and edit it. Or better yet, rename it to content-video.php and you can drastically simplify the coding there. Essentially you’d get rid of most of the if-then logic and use the latter part of the file that displays the full post content. That section starts with this:

    <?php // For single posts and pages, display the full content ?>

    I wish WordPress core would just allow setting a video as the “featured image” (or rename it “featured media”), but it doesn’t allow that.

    Theme Author Tim Nicholson

    (@timnicholson)

    Thanks for the kind words, louis. You can change the index.php file, but since you are only trying to change the way the category archives are displayed you can copy that file to a new one called archive.php and edit that.

    The logic to creating multiple columns using the built-in Bootstrap code is not simple, but you can look at the file page-fullwithsubpages.php for an example. That one displays 2 columns and its easy to change it to 3 columns.

    Theme Author Tim Nicholson

    (@timnicholson)

    Thanks. To change the hover color of the Site Title, you need to add the following CSS:
    .site-title a:hover, .site-title a:active { color: #ff7878; }

    Here is how you’d change the footer title color:
    .sidebar-footer h2 { color: #f2f2f2; }

    I’m not exactly sure what you mean by ensuring the footer stays at the bottom of the page. Do you mean you want to “stick” (affix) the “after footer” (bottom nav and site credits) to the bottom of the screen? If so, you could do its something like this:

    .after-footer {
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        margin-bottom: 0;
        border-width: 1px 0 0;
        width: 100%;
        z-index: 1030;
    }
    .body {
        padding-bottom: 73px;
    }

    The first part fixes it to the bottom of the screen. The second part is necessary so that the content above it doesn’t get chopped off.

    Theme Author Tim Nicholson

    (@timnicholson)

    Hmm, that pesky WordPress admin bar that insists on sitting at the very top. I think they changed the way it works where on a smartphone it inserts itself on top, but then doesn’t “stick” there.

    Thinking through how this should work, I assume most registered users would have that admin bar turned off unless they really were site admin and wanted to see it all the time.

    So we should probably go ahead and override that admin bar on smartphones to fix itself to the top, just like it does for every other browser size.

    Here’s the fix:

    @media screen and (max-width: 600px) {
        #wpadminbar  {
            position: fixed;
        }
    }

    Thanks so much for pointing this out! I’ll include the fix in the next round of updates to all my themes with fixed navbars.

    Theme Author Tim Nicholson

    (@timnicholson)

    If you want to edit the sample page bottom widget, you’d do that in the file sidebar-pagebottom.php. Or you could replicate it in a text widget and make the adjustments there.

    Thread Starter Tim Nicholson

    (@timnicholson)

    Ok, that works perfectly. It would be great if you could update the plugin. Get rid of the call to is_feed() where it is. TRN are my initials, so this is how I “mod mark” adds and deletes

    // No need to minify admin stuff
        //TRN:DEL if (!is_admin() && !is_feed() && !defined('XMLRPC_REQUEST')) {
        if (!is_admin() && !defined('XMLRPC_REQUEST')) { //TRN:ADD

    Then add the check in function pre_content() and post_content() like this:

    function pre_content() {
      	if ( is_feed() ) return; //TRN:ADD
        $wpm_options = get_option($this->name);
        if ($wpm_options['uri_exclude'] && count($wpm_options['uri_exclude'])) {
          foreach ($wpm_options['uri_exclude'] as $exclude_pat) {
            $exclude_pat = trim($exclude_pat);
            if (strlen($exclude_pat) > 0 && strpos($_SERVER['REQUEST_URI'], $exclude_pat) !== false) {
              return;
            }
          }
        }
    function post_content() {
      	if ( is_feed() ) return; //TRN:ADD
        // sanity checking
        if ($this->buffer_started) {
          ob_end_flush();
        }
      }

    I’m surprised this error doesn’t happen for everyone using the plugin. I guess maybe most people don’t have a test site or don’t have errors turned on.

    Thread Starter Tim Nicholson

    (@timnicholson)

    I see no way to fix this other than to modify the code. The offending call to is_feed() is done right when the plugin class is created. That’s why just activating the plugin creates the error. Obviously I can remove that check for is_feed(). I’m sure that won’t negatively impact the plugin, but it will call the minification utility for each hit to the RSS feed.

    There has to be a better way to filter on when the minification should occur, but I’ve not written plugins like this to have a good suggestion. Other than the generic suggestion to go ahead and add the init and wp_footer actions, but then check for is_feed() in those functions and bail out. I’m not 100% sure is_feed() can be called in init, though, without literally testing it.

    function WPMinify() {
        // initialize common functions
        $this->c = new WPMinifyCommon($this);
    
        // load translation
        $this->c->load_text_domain();
    
        // register admin scripts
        add_action('admin_init', array($this->c, 'a_register_scripts'));
        add_action('admin_init', array($this->c, 'a_register_styles'));
    
        // check wp version
        add_action('admin_head', array($this->c, 'a_check_version'));
    
        // load admin menu
        add_action('admin_menu', array($this, 'a_menu'));
    
        // register ajax handler
        add_action('wp_ajax_wpm', array($this, 'a_ajax_handler'));
    
        // No need to minify admin stuff
        if (!is_admin() && !is_feed() && !defined('XMLRPC_REQUEST')) {
          // Don't minify if if user passes wp-minify-off=1 in GET parameter
          if (!(isset($_GET['wp-minify-off']) && $_GET['wp-minify-off'])) {
            add_action('init', array($this, 'pre_content'), 99999);
            add_action('wp_footer', array($this, 'post_content'), 99999);
          }
          // advertise hook
          add_action('wp_footer', array($this, 'advertise'));
        }
      }
Viewing 15 replies - 91 through 105 (of 215 total)