How to stop displaying the Id without losing the functionality

the_author_meta displays the data. That is, it echos the data to the screen. From the Codex entry for that function: NOTE: Use get_the_author_meta() if you need to return (not display) the information. So, use get_the_author_meta() instead. There is a somewhat reliable pattern in WordPress function naming whereby functions starting with the_ echo data to the … Read more

Alternative functions for mysql_free_result and mysql_ping in wordpress functions

You have the following methods of the $wpdb object: $wpdb->flush() that contains a call to mysqli_free_result() or mysql_free_result() if not supported. $wpdb->check_connection() that contains a call to mysqli_ping() or mysql_ping() if not supported. You can of course use all your PHP functions in WordPress. Here’s an example based on the \wpdb class itself: // Use … Read more

Block IP Addresses using Code [closed]

Place in your template’s index.php the following piece of code: $deny = array(“127.0.0.1”, “88.88.88.88”); if (in_array ($_SERVER[‘REMOTE_ADDR’], $deny)) { header(“Location: http://example.com”); die(); } And just change the addresses of $deny for the IP address or addresses you want to block.

Creating custom post type with custom taxonomy and custom fields programatically

Create Custom Post Type function create_product() { $labels = array( ‘name’ => _x( ‘Product’, ‘post type general name’, ‘stacy’ ), ‘singular_name’ => _x( ‘product’, ‘post type singular name’, ‘stacy’ ), ‘menu_name’ => _x( ‘Products’, ‘admin menu’, ‘stacy’ ), ‘name_admin_bar’ => _x( ‘Product’, ‘add new on admin bar’, ‘stacy’ ), ‘add_new’ => _x( ‘Add New’, ‘product’, … Read more

How i can put $_GET codes in function.php?

function custom_function_redirect() { if ( isset( $_GET[ ‘link’ ] ) && $_GET[ ‘link’ ] != ” ) { wp_redirect( $_GET[ ‘link’ ], 301 ); }else{ die(‘test’); } } add_action(‘template_redirect’,’custom_function_redirect’); Try this it worked for me. For redirection you should hook the function in template_redirect

Disable File Editing function

There is no “Enable” button I’m aware of, but if you want to fully disable file editing, then that’s easy. https://codex.wordpress.org/Hardening_WordPress#Disable_File_Editing Add this line to your wp-config.php file: define(‘DISALLOW_FILE_EDIT’, true); No more file editing in WordPress.

Display Data in Table from External Database in WP using Shortcodes

While it is VERY bad practice to have spaces in the object names, there are times where it may be out of your control. You can use the syntax of $object->{‘Property Name’}, like this: // add the shortcode [pontoon-table], tell WP which function to call add_shortcode( ‘pontoon-table’, ‘pontoon_table_shortcode’ ); // this function generates the shortcode … Read more

How can i share codes on my blog?

I’d suggest using Syntax Highlighter Evolved. It’s by Viper007Bond. You can use it like this: [sourcecode lang=”php”] <?php echo ‘Hello World!’; ?> [/sourcecode] Or even like this: [php] <?php echo ‘Hello World!’; ?> [/php] A screenshot: EDIT An example of how you could do the backticks method that SE uses: function wpse13653_content( $content ){ return … Read more

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