Title: somecodeiwrote's Replies | WordPress.org

---

# somecodeiwrote

  [  ](https://wordpress.org/support/users/somecodeiwrote/)

 *   [Profile](https://wordpress.org/support/users/somecodeiwrote/)
 *   [Topics Started](https://wordpress.org/support/users/somecodeiwrote/topics/)
 *   [Replies Created](https://wordpress.org/support/users/somecodeiwrote/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/somecodeiwrote/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/somecodeiwrote/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/somecodeiwrote/engagements/)
 *   [Favorites](https://wordpress.org/support/users/somecodeiwrote/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/users/somecodeiwrote/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/somecodeiwrote/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Additional CSS class(es) missing from advanced settings – text-based links only](https://wordpress.org/support/topic/additional-css-classes-missing-from-advanced-settings-text-based-links-only/)
 *  Thread Starter [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [2 months, 3 weeks ago](https://wordpress.org/support/topic/additional-css-classes-missing-from-advanced-settings-text-based-links-only/#post-18858147)
 * I updated to Yoast SEO 27.2 and can confirm the issue is fixed in version 27.2.
 * Thanks a ton y’all, for fixing this. This will make my life tremendously easier.
 * High five!
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Remove height and width inputs (“Image Dimensions”) from core/image](https://wordpress.org/support/topic/remove-height-and-width-inputs-image-dimensions-from-core-image/)
 *  Thread Starter [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/remove-height-and-width-inputs-image-dimensions-from-core-image/#post-18333111)
 * I don’t think I explained myself well. I am not looking to edit the core block
   itself. I agree that would be a bad idea.
 * What I am looking to do, is streamline the admin. I want to disable the height
   and width inputs, as I am able to do with other things. I remove various pieces
   of Gutenberg functionality via a custom theme or plugin (depending on what I 
   am working on).
 * For example – in the theme.json …
 *     ```wp-block-code
       "dimensions": {"aspectRatio": false,"aspectRatios": [ { "name": "Normal", "slug": "555", "ratio": "auto" } ],"defaultAspectRatios": false}
       ```
   
 * renders the Aspect Ratio functionality effectively inoperable. It is not perfect,
   but it does what I want it to, more or less.
 * I have a JS file, which among other things, disables the duotone and shadow options…
 *     ```wp-block-code
       function removeImageSettings( settings, name ) {if ( ! settings?.supports ) { return settings; }if ( name === 'core/image' ) {return Object.assign( {}, settings, {supports: Object.assign( settings.supports, { filter: { duotone: false, }, shadow: false,} ),} );}return settings;}addFilter( 'blocks.registerBlockType', 'modify-block-supports/remove-image-settings', removeImageSettings, );
       ```
   
 * I disable the image rounded and default as well …
 *     ```wp-block-code
       wp.blocks.unregisterBlockStyle( 'core/image', 'default' );wp.blocks.unregisterBlockStyle( 'core/image', 'rounded' );
       ```
   
 * None of these edits actually change the core source code. I am just turning options
   off, and the settings remain after updates to core.
 * I am hoping to disable the core/image height and width inputs as well and using
   similar methods. I have a custom image block, that does this. I found the aforementioned
   image container block that does this too. I was hoping to simply hook into the
   attributes of the core/image block and disable this feature, like I am able to
   with other stuff.
 * Make sense?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Shortcode to Display Post Count in a Category](https://wordpress.org/support/topic/shortcode-to-display-post-count-in-a-category/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/shortcode-to-display-post-count-in-a-category/#post-18332673)
 * Give this a shot …
 * php =>
 *     ```wp-block-code
       function CategoryCount($atts){$a = shortcode_atts( array( 'category-id' => '555', ), $atts );$CategoryID = $a['category-id'];$CategoryData = get_category( $CategoryID );$CategoryCount = '<p>Category Count: '.esc_html($CategoryData->count).'</p>';return $CategoryCount;}add_shortcode('Category_Count', 'CategoryCount');
       ```
   
 * Shortcode =>
 * [Category_Count category-id=”42″]
 * This should work for the standard post, post type (tested on a dev site).
 * If you need something for a custom post type, you need to pass the custom taxonomy.
   I can fire over a version for custom post type, if needed.
 * cheers
 * scotty
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [more than 6 columns for theme Twenty Twenty Five](https://wordpress.org/support/topic/more-than-6-columns-for-theme-twenty-twenty-five/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/more-than-6-columns-for-theme-twenty-twenty-five/#post-18332404)
 * You can place a columns block within a column block. This means that you can 
   have a theoretical infinite number of blocks in a row.
 * If bold brackets are the parent columns and non-bold are children columns , and
   assuming equal widths …
 * For 8 across – 2 columns with 4 columns in each.
 * **[** [A] [B] [C] [D] **] [** [E] [F] [G] [H] **]**
 * For 9 across – 3 columns with 3 columns each.
 * **[** [A] [B] [C] **] [** [D] [E] [F] **]** **[** [H] [I] [J] **]**
 * For 12 across – 2 columns with 6 columns each, or 3 columns with 4 columns each,
   or 4 columns with 3 columns each
 * **[** [A] [B] [C] [D] [E] [F] **] [** [G][H] [I] [J] [K] [L] **]**
 * **[** [A] [B] [C] [D] **] [** [E] [F] [G] [H] **]** **[** [I] [J] [K] [L] **]**
 * **[** [A] [B] [C] **] [** [D] [E] [F] **]** **[** [G] [H] [I] **]** **[** [J][
   K] [L] **]**
 * You can, of course, do all sorts of offsets or altered widths too. This can create
   more interesting layouts.
 * **[** [A] **] [** [B] [C] [D] [E] [F] [G] [H] **]**
 * **[** [A] [B] [C] **] [** [D] [E] [F] [G] [H] [I] **]** **[** [J] [K] [L] **]**
 * Make sense?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Remove aspect ratio, width and height settings from core image block](https://wordpress.org/support/topic/remove-aspect-ratio-width-and-height-settings-from-core-image-block/)
 *  Thread Starter [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/remove-aspect-ratio-width-and-height-settings-from-core-image-block/#post-17844295)
 * Thank you for this. It was helpful – if only for removing some other items.
 * I found this [https://stackoverflow.com/questions/76621195/add-custom-aspect-ratio-to-wordpress](https://stackoverflow.com/questions/76621195/add-custom-aspect-ratio-to-wordpress)
   which led to [https://github.com/WordPress/gutenberg/issues/48079](https://github.com/WordPress/gutenberg/issues/48079)
   and the idea that the ratios are store via [DEFAULT_ASPECT_RATIO_OPTIONS](https://github.com/WordPress/gutenberg/blob/ac57a486f961aa8bd51622d0c78fab28257fc49f/packages/block-editor/src/components/dimensions-tool/aspect-ratio-tool.js#L17)
 * It sounds like there may be a day when the default aspect ratios can be added
   to – and perhaps removed via theme.json.
 * For now, I think I am stuck with this feature, but will keep trying to disable
   it. I might be able to attack this from the angle of removing all the default
   aspect ratios.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] Block editor assets still enqueued](https://wordpress.org/support/topic/block-editor-assets-still-enqueued/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/block-editor-assets-still-enqueued/#post-11808798)
 * Hey @philclothier –
 * Just an FYI, ACF blocks is all PHP – no JS. That was one of my primary complaints
   about Gutenberg.
 * I have have been working with WordPress for 10 years and had never heard of Meta
   Box. I’ve always used ACF pro. I’ll check it out.
 * Beaver Builder, Elementor or WPBakery Page Builder ar the top 3 page builders
   my customer’s like. Pros and cons to each I suppose. I try to stay agnostic and
   withing reason, give the client what they prefer.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] Block editor assets still enqueued](https://wordpress.org/support/topic/block-editor-assets-still-enqueued/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/block-editor-assets-still-enqueued/#post-11805473)
 * I agree with [@yratof](https://wordpress.org/support/users/yratof/) 100%.
 * I hated Gutenberg when it came out and I am still not a fan. However, I have 
   clients that want to use Gutenberg and the client is king. [ACF blocks](https://www.advancedcustomfields.com/resources/blocks/)
   are the answer for sure.
 * Every WordPress developer I know is familiar with ACF. The blocks addition takes
   about 5-10 minutes to learn, and then you are off and running.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] Block editor assets still enqueued](https://wordpress.org/support/topic/block-editor-assets-still-enqueued/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/block-editor-assets-still-enqueued/#post-10962191)
 * Hey @philclothier –
 * I assume this stylesheet is enqueued because the classic editor plugin has options
   for switching back and forth between classic and gutenberg. It would be harder
   to detect if a post were published in one or the other and then enqueue the styles
   as needed. So, the default is to load up the styles.
 * It does stand to reason that the styles should be not enqueued or dequeued if
   someone chooses: (**“Classic Editor” as the default editor && “No” for users 
   can switch between editors**, because it is saying gutenberg will never be used.
 * For now, I dequeue the styles via a small function.
 *     ```
       function remove_block_css(){
       wp_dequeue_style( 'wp-block-library' );
       }
       add_action( 'wp_enqueue_scripts', 'remove_block_css', 100 );
       ```
   
 * I have others say they need to use 200, 100 works just fine for me.
 * I hope that helps.
 * scotty
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] TinyMCE clobbering multi-line tags with line breaks.](https://wordpress.org/support/topic/tinymce-clobbering-multi-line-tags-with-line-breaks/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/tinymce-clobbering-multi-line-tags-with-line-breaks/#post-10961236)
 * My understanding is that the classic editor plugin is to render the classic editor“
   indistinguishable” from the way it was before Gutenberg, as in the exact same
   support – but don’t quote me on that, I am not the plugin developer.
 * My dev site is WordPress 5.0, Classic Editor 1.1, and my from scratch theme (
   stripped-down, minimal plugins) and I am able to use the below without issue.
   It seems the filters work but this is obviously not a comprehensive list, just
   a sample.
 * **Remove editor**
    `remove_post_type_support( 'post_type', 'editor');`
 * **Allow span, i and other “empty” tags**
 *     ```
       function override_mce_options($initArray) {
       $opts = '*[*]';
       $initArray['valid_elements'] = $opts;
       $initArray['extended_valid_elements'] = $opts;
       return $initArray;
       }
       add_filter('tiny_mce_before_init', 'override_mce_options');
       ```
   
 * **Remove empty tags, like `<p></p>`**
 *     ```
       add_filter('the_content', 'remove_empty_tags_recursive', 20, 1);
       function remove_empty_tags_recursive ($str, $repto = NULL) {
       $str = force_balance_tags($str);
       if (!is_string ($str) || trim ($str) == '') return $str;
       return preg_replace ( '/<([^<\/>]*)>([\s]*?|(?R))<\/\1>/imsU', !is_string ($repto) ? '' : $repto, $str );
       }
       ```
   
 * **Remove Empty** `<p></p>` **tags**
 *     ```
       add_filter('the_content', 'remove_empty_p', 20, 1);
       function remove_empty_p($content){
       $content = force_balance_tags($content);
       return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content);
       }
       ```
   
 * **Remove** `&nbsp;` **in** `<p></p>` **tags – front end**
 *     ```
       add_filter('the_content', 'remove_empty_nbsp', 20, 1);
       function remove_empty_nbsp($string){
       $content = force_balance_tags($string);
       return str_replace('&nbsp;', '', $string);
       }
       ```
   
    -  This reply was modified 7 years, 6 months ago by [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/).
      Reason: Weird single ticks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] P tags everywhere](https://wordpress.org/support/topic/p-tags-everywhere/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/p-tags-everywhere/#post-10961153)
 * Hey [@davetheknave](https://wordpress.org/support/users/davetheknave/) –
 * I appreciate your frustration for sure. Some specifics will help get your bugs
   resolved more quickly. A few questions for you.
 * Can you elaborate on “All of our sites are truncated now”? Can you provide an
   example of some sort (screenshot or link)?
 * Are you getting a lot of empty p tags, like this?
 *     ```
       <p>Well formatted code</p>
       <p></p>
       <p></p>
       <p></p>
       <p></p>
       <p>Oh no! Something is wrong.</p>
       ```
   
 * Cheers
    scotty
    -  This reply was modified 7 years, 6 months ago by [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/).
      Reason: Formatting
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] TinyMCE clobbering multi-line tags with line breaks.](https://wordpress.org/support/topic/tinymce-clobbering-multi-line-tags-with-line-breaks/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/tinymce-clobbering-multi-line-tags-with-line-breaks/#post-10961144)
 * Possibly related, but possibly not. I also have two shortcodes for div’s. The
   first shortcode opens the div and supports a class: **[open_div class=”CustomClass”]**.
   The second closed the div.
 * **Open div:**
 *     ```
       function Div($atts){ $a = shortcode_atts( array( 'class' => 'NONE' ), $atts ); $DivClass = $a['class']; $Div = '<div class="'.$DivClass.'">'; return $Div;
       } add_shortcode('open_div', 'Div');
       ```
   
 * **Close Div:**
    `function CloseDiv(){ $CloseDiv = '</div>'; return $CloseDiv;}
   add_shortcode('close_div', 'CloseDiv');`
 * I love these two shortcodes because I can structure a page and not worry about
   my div’s vanishing due to visual mode.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] TinyMCE clobbering multi-line tags with line breaks.](https://wordpress.org/support/topic/tinymce-clobbering-multi-line-tags-with-line-breaks/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/tinymce-clobbering-multi-line-tags-with-line-breaks/#post-10961140)
 * Hey [@jcryan](https://wordpress.org/support/users/jcryan/) –
 * This isn’t a total fix, but I can relate, so I hope this helps.
 * You might check out this plugin: [https://wordpress.org/plugins/advanced-tinymce-configuration/](https://wordpress.org/plugins/advanced-tinymce-configuration/)
   I use it to change the TinyMCE settings. For example, if a client centers text
   in visual mode, as opposed to adding an inline style (which I hate), it now adds
   a class of text-center. Give that a shot and see if that helps.
 * As far as the CSS … I often add CSS or JS to a specific page. I got tired of 
   issues with code dropping because clients were using visual mode. So, in every
   theme I write, I use two opt-in ACFs (conditional logic based on true-false ACFs)
   that are text fields as opposed to a WYSIWYG (with “no formatting” selected).
 * I do not include the `<style>` or `<script>` tags in the ACF input, as I include
   the tags in the PHP (see below). The CSS I pull into the bottom of the head, 
   the JS the bottom of the body. This gives me a place to put CSS or JS that will
   be pulled into only that page. It is pretty handy.
 * **CSS:**
    `wp_head(); if( get_field('add_css') ) { ?><style><?php the_field('
   additional_css');?></style><?php }` **JS:** `wp_footer(); if( get_field('add_js')){?
   ><script><?php the_field('additional_js');?></script><?php }`
 * I hope that helps. Let me know if you have questions.
 * Cheers
 * scotty
    -  This reply was modified 7 years, 6 months ago by [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/).
      Reason: Typo
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Classic Editor] Remove Classic Editor From Post Type](https://wordpress.org/support/topic/remove-classic-editor-from-post-type/)
 *  Thread Starter [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/remove-classic-editor-from-post-type/#post-10956333)
 * I updated to V1.1 and confirmed the bug is indeed fixed. Thank you so much for
   the update as well as the classic editor plugin in general.
 * Cheers
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Gutenberg] Enabling Gutenberg removes all site content](https://wordpress.org/support/topic/enabling-gutenberg-removes-all-site-content-2/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/enabling-gutenberg-removes-all-site-content-2/#post-10895011)
 * Hey @1503wmike –
 * I would update the star rating to reflect your experience with Gutenberg. It 
   is important that the star rating matches the review. It gives the developers
   feedback that is important. It also helps other folks choose plugins.
 * You can edit your reviews for plugins, including the stars given. This allows
   you to change your mind on a plugin as development happens. Sometimes things 
   get better, sometimes they get worse. Your opinion isn’t forever locked in stone.
 * Logged in to wordpress.org, go [here](https://wordpress.org/support/plugin/gutenberg/reviews/):
   [https://wordpress.org/support/plugin/gutenberg/reviews/](https://wordpress.org/support/plugin/gutenberg/reviews/)
   
   and scroll all the way to the bottom of the page. You should see your review,
   with a title that says: **Now Editing “your title”**. This will allow you to 
   edit your title, comments, and star rating.
 * Thanks for contributing on wordpress.org.
 * Cheers
    scotty
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Gutenberg] I had to uninstall it to write posts](https://wordpress.org/support/topic/i-had-to-uninstall-it-to-write-posts/)
 *  [somecodeiwrote](https://wordpress.org/support/users/somecodeiwrote/)
 * (@somecodeiwrote)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/i-had-to-uninstall-it-to-write-posts/#post-10894998)
 * I agree [@mksnmks](https://wordpress.org/support/users/mksnmks/), [@nazmhud](https://wordpress.org/support/users/nazmhud/)
   should update the star rating to match the review. It is important that the star
   rating matches the review. It gives the developers feedback that is important.
   It also helps other folks choose plugins.
 * [@nazmhud](https://wordpress.org/support/users/nazmhud/), you can edit your reviews
   for plugins, including the stars given. This allows you to change your mind on
   a plugin as development happens. Sometimes things get better, sometimes they 
   get worse. Your opinion isn’t forever locked in stone.
 * Logged in to wordpress.org, go [here](https://wordpress.org/support/plugin/gutenberg/reviews/):
   [https://wordpress.org/support/plugin/gutenberg/reviews/](https://wordpress.org/support/plugin/gutenberg/reviews/)
   
   and scroll all the way to the bottom of the page. You should see your review,
   with a title that says: **Now Editing “your title”**. This will allow you to 
   edit your title, comments, and star rating.
 * Cheers
    scotty

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/users/somecodeiwrote/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/somecodeiwrote/replies/page/2/?output_format=md)