The best solution here is to use the built-in filter for embed parameters:
<?php
function mytheme_embed_defaults( $defaults ) {
return array(
'width' => 100,
'height' => 100
);
}
add_filter( 'embed_defaults', 'mytheme_embed_defaults' );
?>
This code can be added to your theme’s functions.php file and you can change the numbers to reflect the sizes that you desire. You can add conditionals as needed. Maybe something like:
<?php
function mytheme_embed_defaults( $defaults ) {
if ( is_category() ) {
$defaults = array( 'width' => 100, 'height' => 100 );
}
return $defaults;
}
add_filter( 'embed_defaults', 'mytheme_embed_defaults' );
?>
Would work best for you.
Related Posts:
- Get rid of WordPress category, tag and author archives?
- How to add the category ID to admin page
- How to create a widgetized sidebar for every category dynamically?
- Only show category to certain user levels without plugin
- List Categories of the Parent Category of the Current Category
- exclude category from WordPress Form function
- wp_list_categories, Add class to all list items with children
- Remove “Parent” Selection When Adding/Editing Categories?
- Check is category parent or not from its ID
- How to show in search results posts with a particular tag in a particular category?
- How can I get an tag to wrap each ancestor that gets outputted in this condition?
- If category is in parent category?
- How to check If Oembed is empty or not
- If in category to be inside of a function
- Rename Default Category (Uncategorized) Via a Function
- Check child/parent categories if exists
- Getting URL of archive (category) page
- How to show only one category in breadcrumb navigation
- Query posts from category based on a filter most favorited
- Add tag parameter to category.php
- Random Featured Image Based on Category
- add slug beside name in Admin Category Checklists
- Change div background acording to the selected category
- How to use wp_list_categories with plugin category?
- Custom meta boxes ID prefix showing on first category but not others
- Media (images, videos, etc.) not showing on Category page
- Redirect depending on category chosen
- How to add icon over specific thumb
- How to load several hierarchical categories from functions.php
- Change Default Content when Creating a Post based on Previous Category Choice
- How to add a custom thumbnail size for a specific category?
- create function to call category name and slug
- Embed video from streamtape using direct link
- Categories Help and video uploads
- Code to display category-specific single.php is overriding normal single.php, too
- Loop Through Categories in Custom Field
- Function to list posts from current post’s category fails in WP 3.8
- Show only one category in main query, issues on tag page
- Show parent-child relationship for categories in the wordpress admin
- How to display only 3 main categories, separated by commas, since they are marked in the post?
- Create terms when registering taxonomy?
- Add category to custom post type automatically, using category slug
- How do I edit pre_get_post for the category the user is currently in?
- Display Only One Category
- Display only one result from “get_the_category_list”
- Connecting WordPress gallery to custom categories (taxonomy)
- Assign an icon to a category post
- Custom Category/Subcategory structure
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Remove ‘rel’ attributes from the_category() output
- Default category link for a custom category is a broken link
- If statement within PHP echo
- category hierarchy level as a body class – parent cat =1, child cat=2, grandchild=3
- How to show author name only if the post is in a specific category?
- Are Category or Tag Archive Pages Possible?
- 3 Columns, 3 Categories, One Archive, and Pagination
- How to Exclude post from a category
- Hiding a Categories content on just the Homepage ‘Posts’?
- How to change a post category when the ACF datepicker Field is today
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Send to different single pages by category when multiple categories exist
- Multiple Loops on category.php with pagination on last loop
- How can you change the permalink for pages?
- woocommerce related products by specific categories [closed]
- Change the name Category – Not change category name
- custom page for custom Taxonomy
- Why get_category() function is not working not working when embedded in a page?
- How to remove one specific category (uncategorized) from post permalinks
- Combining a meta_query with a category filter
- Theme for subcategories
- How to link a PDF file to a category URL
- Showing posts from 2 categories only on category.php
- Posts not listing out sub category in hierarchy
- Display category and associated post listings
- show only sub categories if available?
- Add properties to term object
- Display all Categories
- How to target all woocommerce categories that don’t have any subcategories in them?
- echo $category[0]-> cat_name; shows only one category name
- Change post category within pre_get_posts
- Ajax Category add doesn’t update the list table custom column
- how to get postmeta info based on multiple categories?
- create post with main category and other categories from admin panel
- How To Display Category list from Portfolio post type plugin?
- get_posts – require all categories
- Add advertising box to a specific category page
- How do you add Author and date Published on Category Pages?
- Twenty Eleven Theme [duplicate]
- display certain category on custom template page
- Get post by Category in custom template
- List products from current category
- comments_number fails to print
- How to show posts of a specific category
- How to show child category name & post from it’s parent [closed]
- List the category tree of all the product_cat categories
- Can’t filter categories using isotope
- Sorting past events by month
- Is there a function to modify existing previous/next post link without modifying theme files?
- Add Input Form for Select Category Like Tags
- Add custom text in second paragraph of posts in specific category