Community Forums › Forums › Archived Forums › General Discussion › TAG COULD FONT SIZE WOES
Tagged: cloud tag
- This topic has 7 replies, 2 voices, and was last updated 6 years, 6 months ago by paularenson.
-
AuthorPosts
-
October 14, 2017 at 6:48 am #212517paularensonMember
I am having trouble. In August I had trouble with my tag cloud in my sidebar in Magazine Pro jutting into the main text of the article. I kept getting the wrong advice to change the font size, which never worked. Then it was pointed out on FB Genesis page that the problem was one of my tags was too long. I fixed that and the problem disappeared.
However, even though I tried to restore the original settings to the functions.php file, the tag cloud looks different than the category cloud above it.
Can anybody advise? Have I messed up the tag cloud font size?
Do not see a way to upload the file, but here it is pasted in. The customize tag widget part is at the very end.
This is very frustrating because the wrong help was given and now rainmaker has suggested I come here.
Thanks
<?php
/**
* Magazine Pro.
*
* This file adds the functions to the Magazine Pro Theme.
*
* @package Magazine
* @author StudioPress
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/magazine/
*/// Start the engine.
include_once( get_template_directory() . '/lib/init.php' );// Setup Theme.
include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );// Set Localization (do not remove).
add_action( 'after_setup_theme', 'magazine_localization_setup' );
function magazine_localization_setup(){
load_child_theme_textdomain( 'magazine-pro', get_stylesheet_directory() . '/languages' );
}// Add the theme helper functions.
include_once( get_stylesheet_directory() . '/lib/helper-functions.php' );// Add the Customizer options.
include_once( get_stylesheet_directory() . '/lib/customize.php' );// Add the Customizer CSS.
include_once( get_stylesheet_directory() . '/lib/output.php' );// Add WooCommerce support.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-setup.php' );// Add the WooCommerce customizer CSS.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-output.php' );// Include notice to install Genesis Connect for WooCommerce.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-notice.php' );// Child theme (do not remove).
define( 'CHILD_THEME_NAME', __( 'Magazine Pro', 'magazine-pro' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/magazine/' );
define( 'CHILD_THEME_VERSION', '3.2.1' );// Enqueue required fonts, scripts, and styles.
add_action( 'wp_enqueue_scripts', 'magazine_enqueue_scripts' );
function magazine_enqueue_scripts() {wp_enqueue_script( 'magazine-entry-date', get_stylesheet_directory_uri() . '/js/entry-date.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Roboto:300,400|Raleway:400,500,900', array(), CHILD_THEME_VERSION );
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script( 'magazine-responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menus' . $suffix . '.js', array( 'jquery' ), CHILD_THEME_VERSION, true );
wp_localize_script(
'magazine-responsive-menu',
'genesis_responsive_menu',
magazine_responsive_menu_settings()
);}
// Define our responsive menu settings.
function magazine_responsive_menu_settings() {$settings = array(
'mainMenu' => __( 'Menu', 'magazine-pro' ),
'subMenu' => __( 'Submenu', 'magazine-pro' ),
'menuClasses' => array(
'combine' => array(
'.nav-primary',
'.nav-header',
'.nav-secondary',
),
),
);return $settings;
}
// Add HTML5 markup structure.
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );// Add Accessibility support.
add_theme_support( 'genesis-accessibility', array( '404-page', 'drop-down-menu', 'headings', 'rems', 'search-form', 'skip-links' ) );// Add viewport meta tag for mobile browsers.
add_theme_support( 'genesis-responsive-viewport' );// Add image sizes.
add_image_size( 'home-middle', 630, 350, true );
add_image_size( 'home-top', 750, 420, true );
add_image_size( 'sidebar-thumbnail', 100, 100, true );// Add support for custom header.
add_theme_support( 'custom-header', array(
'default-text-color' => '000000',
'flex-height' => true,
'header-selector' => '.site-title a',
'header-text' => false,
'height' => 180,
'width' => 760,
) );// Rename menus.
add_theme_support( 'genesis-menus', array( 'primary' => __( 'Before Header Menu', 'magazine-pro' ), 'secondary' => __( 'After Header Menu', 'magazine-pro' ) ) );// Remove skip link for primary navigation.
add_filter( 'genesis_skip_links_output', 'magazine_skip_links_output' );
function magazine_skip_links_output( $links ) {if ( isset( $links['genesis-nav-primary'] ) ) {
unset( $links['genesis-nav-primary'] );
}$new_links = $links;
array_splice( $new_links, 1 );if ( has_nav_menu( 'secondary' ) ) {
$new_links['genesis-nav-secondary'] = __( 'Skip to secondary menu', 'magazine-pro' );
}return array_merge( $new_links, $links );
}
// Add ID to secondary navigation.
add_filter( 'genesis_attr_nav-secondary', 'magazine_add_nav_secondary_id' );
function magazine_add_nav_secondary_id( $attributes ) {$attributes['id'] = 'genesis-nav-secondary';
return $attributes;
}
// Reposition the primary navigation menu.
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );// Remove output of primary navigation right extras.
remove_filter( 'genesis_nav_items', 'genesis_nav_right', 10, 2 );
remove_filter( 'wp_nav_menu_items', 'genesis_nav_right', 10, 2 );// Remove navigation meta box.
add_action( 'genesis_theme_settings_metaboxes', 'magazine_remove_genesis_metaboxes' );
function magazine_remove_genesis_metaboxes( $_genesis_theme_settings_pagehook ) {
remove_meta_box( 'genesis-theme-settings-nav', $_genesis_theme_settings_pagehook, 'main' );
}// Add primary-nav class if primary navigation is used.
add_filter( 'body_class', 'magazine_no_nav_class' );
function magazine_no_nav_class( $classes ) {$menu_locations = get_theme_mod( 'nav_menu_locations' );
if ( ! empty( $menu_locations['primary'] ) ) {
$classes[] = 'primary-nav';
}return $classes;
}
// Customize search form input box text.
add_filter( 'genesis_search_text', 'magazine_search_text' );
function magazine_search_text( $text ) {
return esc_attr( __( 'Search the site ...', 'magazine-pro' ) );
}// Remove entry meta in entry footer.
add_action( 'genesis_before_entry', 'magazine_remove_entry_meta' );
function magazine_remove_entry_meta() {// Remove if not single post.
if ( ! is_single() ) {
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
}}
// Add support for 3-column footer widgets.
add_theme_support( 'genesis-footer-widgets', 3 );// Add support for after entry widget.
add_theme_support( 'genesis-after-entry-widget-area' );// Relocate after entry widget.
remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
add_action( 'genesis_entry_footer', 'genesis_after_entry_widget_area' );// Register widget areas.
http://tokyoprogressive.org/catalonia-mass-resistance-greets-spanish-state-coups-dick-nichols-2392017-green-left-weekly/
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home - Top', 'magazine-pro' ),
'description' => __( 'This is the top section of the homepage.', 'magazine-pro' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle',
'name' => __( 'Home - Middle', 'magazine-pro' ),
'description' => __( 'This is the middle section of the homepage.', 'magazine-pro' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom',
'name' => __( 'Home - Bottom', 'magazine-pro' ),
'description' => __( 'This is the bottom section of the homepage.', 'magazine-pro' ),
) );
//*Customise tag widget
function custom_tag_cloud_widget($args) {
$args[‘largest’] = 20; //largest tag
$args[‘smallest’] = 16; //smallest tag
$args[‘unit’] = ‘px’; //tag font unit
return $args;
}
add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ );October 14, 2017 at 8:09 am #212519Victor FontModeratorFor both the tag and category clouds, the font is assigned to an item based on the number of posts assigned to that particular item. The category or tag that has the largest number of posts will have the largest font size. The item with the fewest posts has the smallest font size. Everything else will fall in between. Here's an article I wrote a long time ago explaining how the tag cloud works. https://victorfont.com/wordpress-tag-cloud-font-size/
On your site, the custom code you are applying to the font size is being applied to both tag clouds in the secondary sidebar. How do I know? Because you are using the the tag cloud widget in both areas and the custom code is being applied universally. In terms of font sizes, they are identical in both areas. If you want to restore the font sizes to the system defaults, comment out this line: add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ );, clear your caches, and refresh the page in the browser while holding down the shift key.
If you are talking about a different dimensions such as widget length or width, or even a different aesthetic, then that's something completely different. But as far as font sizes go, they are the same for both widgets.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?October 14, 2017 at 8:26 am #212521paularensonMemberThank you. I am a little confused because:
1) As you noted, the top one is a category cloud. But I only see code for tag cloud: //*Customise tag widget
function custom_tag_cloud_widget($args) {
$args[‘largest’] = 20; //largest tag
$args[‘smallest’] = 16; //smallest tag
$args[‘unit’] = ‘px’; //tag font unit
return $args;
}
add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ );Does the category cloud use it even though it doesn't say "category cloud"?
2) You said that it is based on how frequently the tag is applied. But looking at the two clouds, the smallest size looks much smaller than the smallest size of 16, doesn't it?
3) In your suggestion, you wrote," If you want to restore the font sizes to the system defaults, comment out this line: add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ );, clear your caches, and refresh the page in the browser while holding down the shift key."
COMMENT OUT MEANS ERASE?
So the end of the file should look like this?
//*Customise tag widget
function custom_tag_cloud_widget($args) {
$args[‘largest’] = 20; //largest tag
$args[‘smallest’] = 16; //smallest tag
$args[‘unit’] = ‘px’; //tag font unit
return $args;
}Thank you again.
October 14, 2017 at 8:54 am #212525Victor FontModerator1. As I said in the original reply, the category cloud IS a tag cloud. It uses the same font filter as the other tag cloud. If you examine your source code using your browser's inspect tool, you will see that the category cloud has the element id of tag_cloud-15 whereas the tag cloud has an element ID of tag_cloud-14. Don't be confused by the widget titles. They are using the same code.
2. You have CSS somewhere else that may be generated by a plugin that is overriding the settings you have in functions.php. If you examine your cloud with the browser inspection tool, you'll see that there is inline CSS changing the font to points (pt), not pixels as directed in functions.php.
3. Commenting out a line of code in PHP does not mean erasing it. It means turning it into a comment. Either of these two examples is a comment:
// add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ ); /* add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ ); */
If you want to solve this problem, you have to start troubleshooting your plugins. This doesn't appear to have anything to do with the Genesis Framework or your Studio Press theme. You may also consider taking the time to learn how to use your browser's inspect tool: https://victorfont.com/how-to-use-your-browsers-inspect-tool/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?October 14, 2017 at 9:54 am #212531paularensonMemberThank you again for the quick reponse. Ok, now I understand what commenting out means. I will try that tomorrow when I am fully awake.
About it not being a Studio Press or genesis issue, yes, I was told that by Rainmaker. But before I changed the size in the functions.php file, it looked normal. I have not added a plugin during that time.
You said you can see the CSS is changing the font size to points. I used the inspection element facility (thank you for the article link) and indeed I did see 8pt.
Now this is the confusing part. Because in experimenting, at one point I remember making that line in the above function.php
$args[‘largest’] = 16; //largest tag
$args[‘smallest’] = 8; //smallest tagIn other words, I was experimenting to see how small 8 would be.
If so, my previous editing of the file was working, so the question is why, when making it
$args[‘largest’] = 20; //largest tag
$args[‘smallest’] = 16; //smallest tagit still shows the 8 pt.
October 14, 2017 at 12:49 pm #212537Victor FontModeratorI don't have an answer for you. The size unit in the custom code is px not pt. I have no idea where the pt is coming from without providing a deeper level of troubleshooting. You said you didn't add a plugin, but you are using plugins that change CSS, specifically Design Palette Pro. I have no idea if that's part of the problem, but if you can't figure it out, you may have to hire a developer for a couple of hours to help you.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?October 14, 2017 at 7:22 pm #212546paularensonMemberThank you.
So let me just clarify what I did based on the advice.
1) I went in and changed the fount size for the largest and smallest.
2) I noticed the small was getting smaller, but my problem was not being solved.
3) I then realized that all I had to do was get rid of the problem tag, which was too long.
4) Then I tried to make a larger size font, but it would not go back.
This literally happened over a few hours.
Bizarre. I am asking in the genesis WP forum as well as there are people there who gave me the original advice.
If I have to hire a developer for a few hours, where do I look ( I want to choose reliable ones) and any estimate on the costs. for such work? Thank you for your help.
October 16, 2017 at 8:40 am #212573paularensonMemberWell, I found the solution after sending someone my functions.php file. It seems I had the wrong encoding (?) for the apostrophe(s) in the code. I am not sure how that happened. Used text wrangler. But it could have been I was in Japanese at the time and didn't realize it.
Thank you for your help, Victor.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.