Gist shortcode is not working

Gist tags and oembed handling is specific to WordPress.com, and doesn’t come bundled with standard WordPress from wordpress.org You will need to acquire a plugin to register gists as an oembed provider, or add embed tags. There are plenty of plugins that do this available, I use this one. If you’d like to write your … Read more

WordPress redirect all 404 pages to the Homepage

Note: I have read somewhere that redirecting all 404 to Homepage is not a good approach for SEO purposes Simplest way to redirect all 404 to homepage in wordpress. if( !function_exists(‘redirect_404_to_homepage’) ){ add_action( ‘template_redirect’, ‘redirect_404_to_homepage’ ); function redirect_404_to_homepage(){ if(is_404()): wp_safe_redirect( home_url(“https://wordpress.stackexchange.com/”) ); exit; endif; } }

Sublime Video: Playlist which gets all attached videos

First of all get all video attachements of the post or page: <?php $attachments = get_children( array(‘post_parent’ => get_the_ID(), ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘video’) ); if ( $attachments ) { ?> 2nd: Load the videos into the playlist code with a unique ID (http://docs.sublimevideo.net/beta/playlists). Here I do use the attachement ID for each video … Read more

Connect Second Database to WordPress

I have found that the following works for connecting the database via the theme’s functions.php file. I placed this code snippet at the end of the existing code in the file. Even though the fatal error threw several line errors when trying to access the site, it only came down to wpdb having an extra … Read more

How do i get (unique) page name?

The WP global variable $pagename should be available for you, I have just tried with the same setup you specified. $pagename is defined in the file wp-includes/theme.php, inside the function get_page_template(), which is of course called before your page theme files are parsed, so it is available at any point inside your templates for pages. … Read more

Where to save common libraries?

I would recommend creating a plugin that holds all of your libraries. In the main plugin file, set a constant that defines the path to the plugin folder so you can easily include the files with your other plugins/themes.

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