Display posts of child category in template

I have searched, and searched, and tried, and finally found…….. <?php global $wpdb; $categories = $wpdb->get_results(“SELECT $wpdb->terms.term_id AS id, name, description from $wpdb->terms INNER JOIN $wpdb->term_taxonomy ON $wpdb->terms.term_id = $wpdb->term_taxonomy.term_id WHERE parent=”$cat” ORDER BY name ASC”); foreach($categories as $category) : ?> <h2><?php echo $category->name; ?></h2> <ul> <li><a href=”https://wordpress.stackexchange.com/questions/147767/<?php echo get_category_link($category->id);?>”><b><?php echo $category->description; ?></b></a> Posts on … Read more

more tag in the $post->content when get_pages were used

You can use the WordPress function get_extended to fetch the different parts of a string (the part before and the part after the <!–more–> tag). get_extended returns an array with three keys, of which the keys main and extended are important: $arr[‘main’] contains the part before the more tag, and $arr[‘extended’] the part after the … Read more

WordPress theme & site not loading after moving files

If you cannot login, use FTP or the file manager to edit wp-config.php and define WP_HOME and WP_SITEURL,. define( ‘WP_SITEURL’, ‘http://www.security-shell.com ‘); define( ‘WP_HOME’, ‘http://www.security-shell.com ‘ ); When you moved files to that subfolder, you probably copied and edited the main index.php file. Make sure that that process gets reversed. That should get things working … Read more

Stream Video Player does not work with do_shortcode()?

It’s not really a shortcode, its a content filter but you can try calling the plugins function directly: if (function_exists(‘StreamVideo_Parse_content’)){ echo StreamVideo_Parse_content(“[stream flv=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 mp4=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 provider=video img=xxx.es/wp-content/uploads/2011/04/previo-video.jpg embed=false share=false width=500 height=333 dock=true controlbar=over bandwidth=high autostart=false opfix=true /]”); }

How to show scaled featured image in template?

You can create custom size image with add_image_size() in the functions.php function add_custom_size_images() { // Add image size width 300 with unlimited height. add_image_size( ‘featured-image-300’, 300 ); } add_action( ‘after_setup_theme’, ‘add_custom_size_images’ ); And in the template to get the size that you created with the_post_thumbnail() the_post_thumbnail( ‘featured-image-300’ ); Notice: If you want it to work … Read more

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