Change text of twentyseventeen_edit_link()

The twentyseventeen_edit_link() function returns an accessibility-friendly link to edit a post or page. Here is its content: function twentyseventeen_edit_link() { $link = edit_post_link( sprintf( /* translators: %s: Name of current post */ __( ‘Edit<span class=”screen-reader-text”> “%s”</span>’, ‘twentyseventeen’ ), get_the_title() ), ‘<span class=”edit-link”>’, ‘</span>’ ); return $link; } Since it doesn’t provide a hook or filter, … Read more

add_image_size is scaling, even though crop is set to true

from your question i under that you want fixed size cropped images when you upload image, why don’t you use wp_get_image_editor. I used it in my project where i wanted cropped images of fixed size so i did this code. $path = $newPath[‘basedir’].’/newImgas/’; $cropfile = uniqid() . ‘.png’; $cropfilename = $path.$cropfile; $cropImage = home_url(). ‘/wp-content/uploads/newImgas/’.$cropfile; … Read more

Where is default wp_head() implemented?

Is there somewhere I can see this default implementation? wp_head() function simply triggers the wp_head action hook that runs all callback functions that were added to this hook using add_action(‘wp_head’,’callback_function’); So there is no default implementation. Can this default implementation be “turned off”? Like we said before since there is no default implementation you need … Read more

add generated stylesheet from parent theme after child-themes style.css

Absolutely! Into functions.php, like you said. I’ll call it cache_busting_styles because I like how it sounds. First, you set up the style via wp_enqueue_style, then call it during the action hook wp_print_styles, Also, you’ll want to set up a variable and pass it in there as the version number as well: function cache_busting_styles() { //however … Read more

Why might $input (Settings API) be coming through empty?

The $input variable is not passed to the validate function by default. You need to declare it, e.g. not this: function mytheme_validate_settings() {} But rather, this: function mytheme_validate_settings( $input ) {} (Or maybe I’m the only one who’s made that bone-headed mistake before?) 🙂 EDIT: The other thing to check: does the $optiongroup in register_setting() … Read more

Why max-width:97.5% on content images?

Since the TwentyEleven theme also includes some default padding and a border for (fluid) images (see CSS below), a width of 100% would push the image outside of its container’s width. This is because of how the box model works: border and padding are added to the width/height. img[class*=”align”], img[class*=”wp-image-“], #content .gallery .gallery-icon img { … Read more

How to change post thumbnail title and alt attributes to post title?

Look at this http://codex.wordpress.org/Function_Reference/the_post_thumbnail second argument in this function you can set a few set fields, such as alt, title, source and class: $default_attr = array( ‘src’ => $src, ‘class’ => “attachment-$size”, ‘alt’ => trim(strip_tags( wp_postmeta->_wp_attachment_image_alt )), ‘title’ => trim(strip_tags( $attachment->post_title )), );

What is the best practice for customizing a plugin’s JavaScript/jQuery?

If a Plugin is coded properly, it will: Use core-bundled jQuery, and any other core-bundled script, rather than bundling/using custom versions of such scripts enqueue its scripts, via wp_enqueue_script(), hooked into an appropriate hook, via an explicit function So, for such a Plugin: You won’t need to worry about customizing/overriding core-bundled scripts, since the Theme … Read more

Add class to before_widget for all widgets with a dropdown and a counter

The CSS classes are applied in the function dynamic_sidebar(). There is no specific filter for that: // Substitute HTML id and class attributes into before_widget $classname_ = ”; foreach ( (array) $wp_registered_widgets[$id][‘classname’] as $cn ) { if ( is_string($cn) ) $classname_ .= ‘_’ . $cn; elseif ( is_object($cn) ) $classname_ .= ‘_’ . get_class($cn); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)