file_get_contents Not allowed in Themes?

Line 49: $data = file_get_contents ( ‘http://example.com’); Don’t use file_get_contents to download web page. WordPress has HTTP API for such needs. In your case, I would suggest you to use wp_remote_get( ‘http://example.com’ ); function instead of file_get_contents. Further reading: WordPress HTTP API wp_remote_get function.

Add social icons in a theme through custom admin menu

I did something similar on my site a while back. I’m sure you can tweak it to fit your needs. Under each article I have an author box with social media icons that link to their accounts. In content-single.php <?php if ( get_the_author_meta(‘twitter’) ) : ?> <a href=”http://www.twitter.com/<?php the_author_meta(‘twitter’); ?>” title=”Twitter”><img src=”<?php bloginfo( ‘url’ ) … Read more

WooCommerce: VAT on grouped products

code update: add_action( ‘woocommerce_grouped_product_list_before_price’, ‘woocommerce_grouped_product_tax_on_single’, 10, 1, $child_product, $mode ); function woocommerce_grouped_product_tax_on_single( $child_product, $mode = null ) { //uncomment next line and choose one of the output options from »switch case “{OPTION}”« //$mode=”tax-name-rate-amount”; $_taxobj = new WC_Tax(); $obj = $_taxobj->get_shop_base_rate($child_product->get_tax_class()); $i_or_e = get_option(‘woocommerce_prices_include_tax’) == ‘no’ ? ‘excl.’ : ‘incl.’; ?> <td class=”grp_tax”> <?php foreach ( … Read more

Setting a Default ‘Theme Location’ When Creating a Menu

You need to first collect the menu locations, then set the primary menu location with the menu id. // Set the menu to primary menu location $locations = get_theme_mod( ‘nav_menu_locations’ ); $locations[‘primary’] = $primary_nav_menu_id; set_theme_mod ( ‘nav_menu_locations’, $locations ); Here I assume ‘primary’ is theme location referring to ‘Primary Navigation’.

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