Home User profile
tagDiv Member
The Medium is the student newspaper of the University of Toronto Mississauga. We use tagDiv's excellent Newspaper theme, with some style and under-the-hood functionality customization.
TheMediumUTM
tagDiv Member

Had kind of the same question. Actually, on our old site, we had a custom taxonomy hack for both volume (year) and issue (week), with some theme integration. But I decided it wasn’t worth recreating when we moved. That information is mostly important for the print edition, so I just linked to PDFs of those from an archive page, and left it as simply posts by date range for those who want to see back issues online.

If they don’t decide to include this feature in the theme someday, there are a number of ways to make a custom taxonomy in WP – but having it well-integrated into the theme will be a bit of a headache if you’re not up on php.

TheMediumUTM
tagDiv Member

Thanks 🙂

TheMediumUTM
tagDiv Member

Thanks; pretty good solution.

I also found out that this CSS property exists: http://www.w3schools.com/cssref/pr_text_white-space.asp and can be set to “nowrap”. Neat! Of course, since this only seems to happen now and then, I guess I’ll never know if it works, only if it doesn’t work…

TheMediumUTM
tagDiv Member

Ah, okay 🙂

TheMediumUTM
tagDiv Member

I found this very helpful for doing more or less the same thing:

http://stackoverflow.com/questions/13850313/how-to-add-a-featured-image-caption-in-wordpress

TheMediumUTM
tagDiv Member

Here it is and here’s how I got it:

1. Copied and pasted your child theme functions code

2. Copied and pasted the function td_load_css from the parent theme’s functions code

3. Changed the name from td_load_css to my_td_load_css

4. Changed the line you mentioned to include ‘&subset=latin,latin-ext’

5. Copied the two extra lines I mentioned in my first post and pasted them at the very end

See if this works:

/*  ----------------------------------------------------------------------------
    WordPress booster framework - this is our theme framework - all the content and settings are there
    It is not necessary to include it in the child theme only if you want to use the API
*/
if (!defined('TD_THEME_WP_BOOSTER')) {
	include TEMPLATEPATH . '/includes/td_wordpres_booster.php';
}

function my_td_load_css() {

    //google fonts
    if ((defined('TD_DEPLOY_MODE') and (TD_DEPLOY_MODE == 'demo' /*or TD_DEPLOY_MODE == 'dev' */)) or defined('TD_SPEED_BOOSTER')) { //on demo and dev we load only the latin fonts
        //modify this collection if you want to optimize the fonts loaded
        //collection url -> : http://www.google.com/fonts#ReviewPlace:refine/Collection:PT+Sans:400,700,400italic|Ubuntu:400,400italic|Open+Sans:400italic,400|Oswald:400,700|Roboto+Condensed:400italic,700italic,400,700
		
        wp_enqueue_style('google-font-rest', td_global::$http_or_https . '://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic|Ubuntu:400,400italic|Open+Sans:400italic,400|Oswald:400,700|Roboto+Condensed:400italic,700italic,400,700&subset=latin,latin-ext'); //used on menus/small text
		
		// Above line has been modified in child theme to include '&subset=latin,latin-ext'
		
    } else {

        $td_user_fonts_list = array();
        $td_user_fonts_db = td_util::get_option('td_fonts');
        if(!empty($td_user_fonts_db)) {
            foreach($td_user_fonts_db as $td_font_setting_key => $td_font_setting_val) {
                if(!empty($td_font_setting_val) and !empty($td_font_setting_val['font_family'])) {
                    $td_user_fonts_list[] = $td_font_setting_val['font_family'];
                }
            }
        }

        if(!in_array('g_438', $td_user_fonts_list)) {//'g_438', //Open Sans
            wp_enqueue_style('google-font-opensans', td_global::$http_or_https . '://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic'); //used on menus/small text
        }

        if(!in_array('g_617', $td_user_fonts_list)) {//'g_617', //Ubuntu
            wp_enqueue_style('google-font-ubuntu', td_global::$http_or_https . '://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic&subset=latin,cyrillic-ext,greek-ext,greek,latin-ext,cyrillic'); //used on content
        }

        if(!in_array('g_453', $td_user_fonts_list)) {//'g_453', //PT Sans
            wp_enqueue_style('google-font-pt-sans', td_global::$http_or_https . '://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic&subset=latin,cyrillic-ext,latin-ext,cyrillic'); //used on content
        }

        if(!in_array('g_445', $td_user_fonts_list)) {//'g_445', //Oswald
            wp_enqueue_style('google-font-oswald', td_global::$http_or_https . '://fonts.googleapis.com/css?family=Oswald:400,300,700&subset=latin,latin-ext'); //used on content
        }

        if(!in_array('g_521', $td_user_fonts_list)) {//'g_521', //Roboto
            wp_enqueue_style('google-roboto-cond', td_global::$http_or_https . '://fonts.googleapis.com/css?family=Roboto+Condensed:300italic,400italic,700italic,400,300,700&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic'); //used on content
        }

        if(!in_array('g_639', $td_user_fonts_list)) {//'g_639', //Vollkorn
            wp_enqueue_style('google-vollkorn', td_global::$http_or_https . '://fonts.googleapis.com/css?family=Vollkorn:400italic,700italic,400,700'); //used on quoates classic
        }
    }

    //add the google style link for fonts used by user
    $td_fonts_css_files = td_util::get_option('td_fonts_css_files');
    if(!empty($td_fonts_css_files)) {
        wp_enqueue_style('google-fonts-style', td_global::$http_or_https . $td_fonts_css_files);
    }

    //bootstrap - custom built - it was generated via compilation of /external/bootstrap-master/less/bootstrap.less
    $responsive = td_util::get_option('tds_responsive');
    switch ($responsive) {
        case '980_responsive':
            wp_enqueue_style('td-bootstrap', get_template_directory_uri() . '/includes/wp_booster/external/bootstrap/td-bootstrap-980-responsive.css', '', TD_THEME_VERSION, 'all' );
            break;

        case '980':
            wp_enqueue_style('td-bootstrap', get_template_directory_uri() . '/includes/wp_booster/external/bootstrap/td-bootstrap-980-not-resp.css', '', TD_THEME_VERSION, 'all' );
            break;

        case '1170':
            wp_enqueue_style('td-bootstrap', get_template_directory_uri() . '/includes/wp_booster/external/bootstrap/td-bootstrap-1170-not-resp.css', '', TD_THEME_VERSION, 'all' );
            break;

        default:
            wp_enqueue_style('td-bootstrap', get_template_directory_uri() . '/includes/wp_booster/external/bootstrap/td-bootstrap.css', '', TD_THEME_VERSION, 'all' );
            break;
    }

    //main theme style - set the TD_DEBUG_USE_LESS flag in /includes/app/td_config.php and the theme will load the less files and compile them for you
    if (TD_DEBUG_USE_LESS) {
        wp_enqueue_style('td-theme', get_template_directory_uri() . '/td_less_style.css.php',  array('td-bootstrap'), TD_THEME_VERSION, 'all' );
        //wp_enqueue_style('td-theme', get_template_directory_uri() . '/style.less', array('td-bootstrap'), TD_THEME_VERSION, 'all' );
    } else {
        wp_enqueue_style('td-theme', get_stylesheet_uri(), array('td-bootstrap'), TD_THEME_VERSION, 'all' );
    }
}

remove_action('wp_enqueue_scripts', 'td_load_css');
add_action('wp_enqueue_scripts', 'my_td_load_css')
TheMediumUTM
tagDiv Member

Hmm… not sure. Might just have to have one block for the teaser, and a separate block for the smaller titles, in each column. But I just tried it out and couldn’t find an arrangement of blocks that gave me that. :/ Hopefully tagDiv support has an idea.

TheMediumUTM
tagDiv Member

P.S. daicadung: I later simplified my implementation by editing single.php instead of single_template_4.php.

Instead of steps 3 and 4 in the above link, just find this in single.php:

if(empty($td_post_theme_settings['td_post_template']) and !empty($td_default_site_post_template)) {
    $td_post_theme_settings['td_post_template'] = $td_default_site_post_template;
}

And replace it with this:

if(empty($td_post_theme_settings['td_post_template']) and !empty($td_default_site_post_template)) {
	
	if ($td_default_site_post_template == 'single_template_4') {
		if (!has_post_thumbnail($post->ID)) {
			$td_default_site_post_template = 'single_template_2';
		}
}
	$td_post_theme_settings['td_post_template'] = $td_default_site_post_template;
}

Let us know if you’re trying this and/or want help 😀

TheMediumUTM
tagDiv Member

Looks to me like a row split into two columns in VC and each column filled with a Block 2 set to show 5 posts. It might also be separate blocks for top and bottom.

TheMediumUTM
tagDiv Member

Hmm… Well, luckily the tabs do have unique IDs in VC’s system. But since the query is custom I wouldn’t be able to pass those variables to the script. Maybe if I could edit the script to deal with a presupplied array of posts instead, or something… but I don’t have that skill yet. Thanks anyhow! :p

TheMediumUTM
tagDiv Member

You would copy just the code you need. Doubling the whole functions.php in parent and child themes tends to generate errors and give you a white screen of death.

But sadly it’s not quite that simple. The line you added is part of another function in the parent: td_load_css. To alter it, copy the whole function you’ve edited into your child theme’s functions.php. You’ll know it’s the end because you’ll see this line:

add_action('wp_enqueue_scripts', 'td_load_css');

Don’t include that.

Now rename your new copy like this:

function my_td_load_css {
...

Then you need to unhook the original function and hook your new one in by adding these lines after the function:

remove_action('wp_enqueue_scripts', 'td_load_css');
add_action('wp_enqueue_scripts', 'my_td_load_css')

Let me know if it doesn’t work!

TheMediumUTM
tagDiv Member

Hmm, Googling this suggests that a lot of people have this question but the answer seems to involve creating a custom category template with a custom query. Things like this would start you off: http://wordpress.stackexchange.com/questions/47861/different-number-of-posts-in-each-category But I’m not sure how to easily integrate that with the theme’s category template options.

But tagDiv support will be back after the weekend 🙂

TheMediumUTM
tagDiv Member

Welcome!

TheMediumUTM
tagDiv Member

Steal the position: absolute; from entry-comments-views and give it to your custom class:

header .entry-comments-views {
  position: static !important;
}

.my_avatar_box {
  position: absolute;
  top: auto;
  bottom: 0px;
  right: 0px;
}

Now that’s the one that’s pushed up against the right side and has the text flow naturally inside it. So echo that around both the new statements and the call to get_commentsAndViews:

<?php echo '<div class="my_avatar_box">';?>
<?php echo get_avatar($post->post_author, '16');?>
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_commentsAndViews();?>
<?php echo '</div>';?>

Note that for a cleaner author output, you could do this for the third line instead:

<?php echo '<a itemprop="author" href="' . get_author_posts_url($post->post_author) . '">' . get_the_author_meta('display_name', $post->post_author) . '</a>';?>

Which I just grabbed from the function get_author in the theme files, and dropped the “by” and the dash on either side.

You have to promise me that you’re learning from this experience :p

TheMediumUTM
tagDiv Member

Yup, you don’t. We get a version bundled with the theme, and tagDiv includes the latest one with each new theme update.

Some people are so annoyed by the update counter that they buy a VC licence just to keep it up to date (I considered it…). But some people have reported problems with that, because tagDiv tests each new version’s compatibility before including it in a theme update. So it’s safest just to not update it.

TheMediumUTM
tagDiv Member

Please give more context. You could mean posts actually in the category, or posts displayed per page in a category archive, or posts displayed in a block set to a certain category… not sure yet!

TheMediumUTM
tagDiv Member

No need to do it separately – at least, I didn’t :p

TheMediumUTM
tagDiv Member

Try top: auto; bottom: 0px; and right: 50px; (Still haven’t implemented this on my site for testing, so not sure.) Then modify right: to something else.

TheMediumUTM
tagDiv Member

I saw this behaviour once, not with this slider or theme, but with another slider plugin on a different theme. I switched themes, not plugins, and it worked again, oddly enough…

Only one suggestion occurs to a layman like me: Ensure that when you update the theme, you also install the version of WPBakery Visual Composer included with it. If it’s not that, I’m not sure what it is.

TheMediumUTM
tagDiv Member

There’s a “post type” setting when you’re creating a block. If your CPTs have names that it can recognize, that will probably work (haven’t tried it myself)

TheMediumUTM
tagDiv Member

Has something to do with permalinks. The preview is trying to load it by ID, maybe, but the link is the slug, so it doesn’t find it. Or vice versa. I haven’t worked with custom post types, so unfortunately I can’t outline the steps to fix.

On a side note, the similar name preview is actually the same as 404. If you put in a slug that doesn’t exist, WP suggests the end of the slug. If it can’t find any matches, you get 404. You learn something every day 😀

TheMediumUTM
tagDiv Member

I had the exact same problem. If you’re willing to dig into child themes and a bit of PHP, I outlined my solution here:

https://forum.tagdiv.com/topic/single-4-without-featured-image/

(I’m happy to elaborate if you’re interested and need any more detail)

TheMediumUTM
tagDiv Member

Assuming you have those areas set up for users to view, yeah.

Never done this myself, but here’s a possible starting point for WordPress-esque editing of admin bar, probably to be used in functions.php: http://codex.wordpress.org/Class_Reference/WP_Admin_Bar

TheMediumUTM
tagDiv Member

Red x means being looked at, I think. 🙂 But note that support doesn’t seem to be active on the weekend.

I’m not sure what you mean when you say that the slider is falling under the image, but two things to note about the sliders there: the top one looks like it has no slides to load, and the Big Slider below that looks unusual because your featured images are very small. Try reuploading those to each post in a larger size.

TheMediumUTM
tagDiv Member

TagDiv support is very helpful and patient and gave you the uncomment get_author advice a couple of times… the rest is just stuff I’ve learned by reading the files and some PHP and CSS tips when I was in your position two weeks ago. You don’t need everything spelled out for you :p

For positioning CSS elements you have a few options. The way the comments and views are done is by using position: absolute;, which allows you to specify the distance from the edges of the container by using top: 0px;, left: 0px;, and so forth. Your div’s class could use something like that.

Viewing 25 posts - 251 through 275 (of 349 total)