... WordPress theme test data with the above Loop construct, you end up with something that looks similar to the example shown in following screenshot: Trang 5Chapter 34 Depending on your theme's ... $ad_counter ) { echo '<h2 style="color:red;">Advertisement</h2>'; } } } ?> Trang 7Chapter 351 If you've done everything correctly, and are using the WordPress theme test data, ... Note the name of the category, and then open or create your theme's functions.php file Your functions php file resides inside of your theme's directory and may contain some other code Inside of
Ngày tải lên: 04/07/2014, 15:20
... <div class="post <?php echo $alt_post; ?>"> <h2><?php the_title(); ?></h2> </div> <?php } } ?> Now open your theme's stylesheet, style.css, ... post content differently for sticky posts Creating multiple loops in a single template In advanced themes, there are often situations where you would want to display multiple Loops consisting of ... { $query1->the_post(); ?><h2><?php the_title(); ?></h2><?php } } echo '<hr />'; $query2 = new WP_Query(array('cat'=>get_cat_ID('Cat B'))); if( $query2->have_posts()
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 10 pot
... dynamic sidebar in your theme Including multiple dynamic sidebars in your theme Setting the default widgets for a sidebar in your theme Positioning multiple sidebars in your theme by using CSS Styling ... ready For this recipe, you'll need to have a basic theme installed, or be in the process of building your own theme Oh, and make sure that the theme that you downloaded or created has a place set ... your theme folder How it works The get_sidebar function is a special template tag that, just like get_header and get_footer, calls a specific template file in the current theme When the main theme
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 11 potx
... ?> tag within the file: $current_theme = get_option( 'template' ); $target_theme = 'Widgety_Theme'; if ( is_admin() && current_user_can( 'switch_themes' ) && isset( $_GET['activated'] ... following variables before the code will work with your theme: $target_theme—replace Widgety_Theme with the name of the folder in which your theme resides $preset_widgets—replace the array with ... this code only works when a theme is activated; so deactivate this theme if it is your current theme, then upload the updated functions.php file and reactivate your theme, or install it on a test
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 12 pot
... theme that you previously acquired or developed If you haven't started developing a custom theme yet, I recommend using the Thematic theme It can be freely downloaded from the WordPress.org Theme ... your theme Visit http://codex.wordpress.org/ Customizing_Your_Sidebar to learn more Showing asides in the sidebar by using the Miniposts plugin Asides are a concept unique to blogging When a blogger ... ready You will need a theme that contains a sidebar.php file, or else you can create one using earlier recipes in this book We will be using a variation of the Classic WordPress theme in this recipe
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 13 docx
... need to be working with a theme that you previously acquired or developed. If you haven't started developing a custom theme yet, I recommend using the Thematic theme. It can be freely downloaded ... need to be working with a theme that you previously acquired or developed. If you haven't started developing a custom theme yet, I recommend using the Thematic theme. It can be freely downloaded ... First, a list of all les contained in the currently-active theme's directory is generated and returned from the get_current_theme function. Next, WordPress iterates over each le, reading
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 14 pot
... theme that you previously acquired or developed If you haven't started developing a custom theme yet, I recommend using the Thematic theme It can be freely downloaded from the WordPress.org Theme ... theme that you previously acquired or developed If you haven't started developing a custom theme yet, I recommend using the Thematic theme It can be freely downloaded from the WordPress.org Theme ... avatars and descriptions Multi-author blogs are gaining momentum in the professional and business blogging world As such, if you're producing a business theme for WordPress, you might want to
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 15 ppt
... theme that you previously acquired or developed If you haven't started developing a custom theme yet, I recommend using the Thematic theme It can be freely downloaded from the WordPress.org Theme ... started developing a custom theme yet, I recommend using the Thematic theme It can be freely downloaded from the WordPress.org Theme Repository, at http://wordpress.org/extend/themes/thematic/ How to ... href="<?php echo $item->get_link(); ?>"> <?php echo esc_html($item->get_title()); ?> </a><br /> <a href="<?php echo esc_attr( $item->get_enclosure()->get_link());
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 16 doc
... compatible theme that you like, or apply these recipes to your own custom theme Trang 2Aligning images properly within a postOne of the most important things for your theme to get ... you are using the default Kubrick theme that it is not designed well for the display of videos or images within posts We will be using the WordPress Classic theme, which is available with all ... WordPress tools This is very important to theme users, and forgetting to properly account for aligning images will give a very poor impression of your theme Luckily, it is one of the easiest things
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 17 pdf
... loading articles and effects The theme includes a theme switcher so that mobile visitors can view your site in the WPtouch theme or your standard site theme The theme can be downloaded from ... <p>Image:</p> <?php echo wp_get_attachment_link($post->ID); ?> Add the content in the code below to the audio.php file: <p>Audio:</p> <?php echo wp_get_attachment_link($post->ID); ... started You need to have a basic theme created for this recipe, including index.php, function.php, and single.php template files How to do it First, open up your theme's functions.php file, and
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 18 ppsx
... <li> <a href="<?php echo $url; ?>"> <?php echo get_the_author_metắdisplay_namé, Trang 6Save the sidebar file and upload it to the theme folder on your server You should ... ?> <li> <a href="<?php echo $url; ?>"> <?php echo get_the_author_metắdisplay_namé,$user_ID); ?> - <?php echo human_time_diff($time); ?> </a> ... started You will need a modern WordPress theme, such as Sandbox from http://plaintxt.org, and an author.php page How to do it… First, open or create your theme's author.php file Place your cursor
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 19 pdf
... This file will reside within your theme Open your theme's folder and create a js folder Inside the js folder, create a file called my-theme.js Open the my-theme.js file, and insert the following ... your theme's functions.php file In functions.php, add the following code inside a PHP block: if( !is_admin() ) { wp_enqueue_script( 'my-theme', get_bloginfo('stylesheet_directory') '/js/my-theme.js' ... type="text/javascript" src="<?php bloginfo('stylesheet_ directory'); ?>/js/my-theme.js"></script> After doing this, load your WordPress site with your theme active, and you'll be greeted
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 20 docx
... your blog homepage after adding the code specified previously, you'll see something like the following: <script type='text/javascript' src='http://wp.local/wp-content/themes/my-theme/js/my-theme. ... following function to call a simple JavaScript file: wp_enqueue_script( 'my-theme', get_bloginfo('stylesheet_ directory') '/js/my-theme.js' ); This contained a handle (the name of the script, a lowercase ... in your theme Paste the following code within the functions.php file, just below the comment area at the beginning of the file: if( !is_admin() ) { wp_enqueue_script( 'my-theme', get_bloginfo('stylesheet_directory')
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 22 pps
... add_admin_stuff() { add_theme_page( ('My Theme'), ('My Theme'), 'switch_themes', 'my-theme', array(&$this, 'display_theme_admin_page')); } function display_theme_admin_page() { ... add_admin_stuff() { add_theme_page( ('My Theme'), ('My Theme'), 'switch_themes', 'my-theme', array(&$this, 'display_theme_admin_page')); } function display_theme_admin_page() { ... update_option('My Theme Custom Settings', $this->settings); } } } $my_theme = new My_Theme(); function get_custom_theme_header_color() { global $my_theme; $settings = $my_theme->get_settings();
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 23 doc
... theme's user has chosen for their color scheme See also Adding a theme options page Changing the default Gravatar icon for your theme A great way to build a community around a blog is to allow ... add_filter('pre_option_avatar_default', 'force_my_theme_default_ avatar'); function add_my_theme_default_avatar($avatars) { return array(); } function force_my_theme_default_avatar($value) { return get_bloginfo('stylesheet_directory') ... using shortcodes with WordPress themes Localizing your theme WordPress themes are used by people all over the world Luckily, it is relatively easy to localize your theme by modifying code We will
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 24 pot
... for themes will turn up your theme Include links to your theme and the downloadable ZIP file Visit the WordPress theme repository at http://www.wordpress.org/extend/themes to view other themes, ... CSS at http://www.w3schools.com, for most issues Organize your theme structure to match the way that other themes are set up This means keeping your style.css file in the main theme folder, and ... test, and then test your theme some more, using various test blogs, different plug-ins, when the theme is active and inactive, and in other instances You cannot test your theme enough Double-check
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 25 pptx
... header image Making theme components drag-and-drop Creating a global toolbar for your theme Creating tabbed navigation for your theme Introduction The basis of any good WordPress theme is a solid ... that all of the content for the theme is wrapped in an element with an id attribute of wrap Seeing this, we can start to correctly style the theme to center the theme in the browser Next we need ... <body> tag of your theme It should go after your page's main heading or company name, but before anything else To implement this, open up the file containing your theme's header (this should
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 26 pdf
... background of the header div, and the header text (in this case the blog's name) renders on top of the image. Making theme components drag-and-drop The best websites provide means for their ... <div class="piece" id="user_cat_<?php echo $category->term_id; ?>" > <h2> <?php echo esc_html($category->name); ?> </h2> <ul> ... the proper dependencies. First, ensure that your theme's head element has a wp_head function call within it. Then, open or create your theme's functions.php le, and insert the following
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 27 potx
... actions right at the top of your site's theme This is what WordPress.com does, and in this recipe, is what you'll do. Getting started You need to have a basic theme constructed and, for the best ... positions. See also Creating a simple page template Trang 3Creating a global toolbar for your themeHaving a great site is one thing, but building a community is quite another To really push ... $cats = (array)$args['user_cat']; setcookie('user-cat- order',maybe_serialize($cats),time()+3600*24*31); exit(); } } global $user_cat_order; $user_cat_order = unserialize(stripslashes($_COOKIE['user-cat-order']));
Ngày tải lên: 04/07/2014, 15:20
Hướng dẫn tạo themes cho wordpress part 21 ppt
... shortcodes for your theme Localizing your theme Displaying information based on the logged-in user's role Packaging your theme for distribution Uploading your theme to the WordPress.org theme repository ... 9Advanced WordPress Themes In this chapter, we will cover: Adding a theme options page Allowing for multiple theme color schemes Changing the default Gravatar icon for your theme Registering shortcodes ... users with the best possible experience Adding a theme options page As a theme developer, you have to make a lot of choices when you create a theme What text should be displayed in certain locations?
Ngày tải lên: 04/07/2014, 16:21