hide “Open in New Tab” checkbox in link field

Site-Wide Checkbox Hide You can add a simple function to your functions.php to change its visibility (and will also set the default checked state to false): function disable_open_new_window() { ?> <script type=”text/javascript”> jQuery(document).ready(function ($) { $(‘input#link-target-checkbox’).prop(‘checked’, false); $(‘#wp-link .link-target’).css(‘visibility’, ‘hidden’); }); </script> <?php } add_action (‘after_wp_tiny_mce’, ‘disable_open_new_window’); This will change the visibility of that checkbox … Read more

When inserting media file in a post or page, show file name under the thumbnail

By default, WordPress doesn’t provide a built-in option to sort media attachments by file name in the media library interface. However, you can achieve this programmatically or with the help of plugins. Using Plugins: Plugins like “Media Library Assistant” or “Media Library Categories” offer advanced sorting and filtering options for the media library, including sorting … Read more

How to make Fake Views on WordPress

Use something like this : (add it in your function.php) and load your site once. after it finish, deactivate the function. (don’t forget to declare your $postID) function my_update_posts() { $count_key = ‘post_views_count’; $args = array( ‘post_type’ => ‘post’, ‘numberposts’ => -1 ); $myposts = get_posts($args); foreach ($myposts as $mypost){ $mypost->post_title = $mypost->post_title.”; $count = … Read more

Post rank by views

Is there any specific reason you are using $wpdb? You can do the same with WP_Query which is always recommended. So if your meta key for counting post views is views then you can run this WP_Query to return top viewed posts. You can also limit results by posts_per_page. <?php $args = array( ‘post_type’ => … Read more

Updating post_views_count on publish [duplicate]

So this is the code I earlier posted. // Create custom field on post publish function wpse_custom_field_on_publish( $new, $old, $post ) { if ( $new == ‘publish’ && $old != ‘publish’ && !get_post_meta( $post->ID, ‘post_views_count’, true ) ) { add_post_meta( $post->ID, ‘post_views’, rand(829, 1013), true ); } } add_action( ‘transition_post_status’, ‘wpse_custom_field_on_publish’, 10, 3 ); Let … Read more

Display (custom) post number of views

This is a repurposed post from another question which the OP did not find useful, so I’m reposting it here and hopefully will be useful here Please modify the code as needed. Here is a post I have recently done on stackoverflow. It is a modified version of the code you are using. I had … Read more

Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode

The following code is partialy taken from the plugin Taxonomy Images and it’s working: function get_taxonomy_image( $atts ) { $atts = shortcode_atts( array( ‘image_size’ => ‘thumbnail’, ‘id’ => ”, ), $atts ); if( ! empty( $atts[‘id’] ) ) { $term = get_term( $atts[‘id’] ); $related_id = 0; if ( isset( $term->term_taxonomy_id ) ) { $related_id … Read more

Integrating CSS Into a WP Function Call [closed]

Apart from the fact, that the conditional is based on a WordPress option, this is pure PHP, but anyhoo: <?php $show_views = get_option( ‘to_post_views’ ); if ( ‘Yes’ === $show_views ) { echo ‘<div class=”postviews”>’ . getPostViews( get_the_ID() ) . ‘</div>’; } ?>

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