The method of using simple tags plugin to realize output related log in WordPress inove theme

Source: Internet
Author: User
Tags format log php file php web development return wordpress version

Consider all aspects of the situation, I did not use some other WordPress related log (relatedposts) Plug-ins, but the full application of simple tags plug-ins Powerful related logs, related tag functions, combined with Inove theme, the use of simple tags to achieve the output related log function, it feels good. Although simple tags can be in the background to set the relevant log, but the added related log list can not control the location of its occurrence.

The installation steps are as follows:

  The first step : Download and install simple tags plug-in. Why do I have to install this plugin first? Because simple tags plug-ins can produce related logs according to the label.

  The second step : Login to your wordpress background, click the appearance-> edit menu, on the right side of the page you apply the theme template to find and click on the article page template (single.php) file

and find the relevant annotation <!–related posts start–><!–related posts End–>, add the following code in the middle

1
2
3
4
5
6
7
8
9
<?php
if (Is_single () && function_exists (' st_related_posts '))
{
Echo ' <div id= ' related_posts ' > ';
St_related_posts (' Number=10&include_page=false&order=data-asc ');
Echo ' </div> ';
Echo ' <div class= ' fixed ' ></div> ';
}
?>

  st_related_posts is a wordpress simple tags plug-ins in a function of the implementation of the relevant log function, the specific function shows you can see simple tags plug-in relatedposts function description Chinese version.

  Step three : Enter simple tags plug-in directory, in 2.7 directory (here corresponds to the WordPress version you use, simple tags currently support wordpress2.3/2.5/ In version 2.7), locate and open the simple-tags.client.php file, find the function relatedposts ($user _args = ", $copyright = True)and locate it in the function

  return $this->outputcontent (' st-related-posts ', $format, $title, $output, $copyright, $separator);

Replace the first argument ' st-related-posts ' with ' related_post ', that is,

  return $this->outputcontent (' Related_post ', $format, $title, $output, $copyright, $separator);

  Note : The first parameter represents the div output CSS style that you use to define the theme.

  Fifth Step : Modify the Inove theme CSS file Style.css in the #related_posts H3 to #related_posts h4, because simple Tags Related log column name default format is H4.

After the above steps, the use of WordPress simple tags plug-ins in the inove theme of the implementation of the relevant log (relatedposts) declared success. With this feature, although a plug-in is less used, the functionality remains unchanged. Check a lot of data, it is said that plug-ins use more, WordPress performance will weaken, I did not pass the test, I do not know is true.

  Note : PHP Web Development Tutorials-leapsoul.cn Copyright, reproduced in the form of links to indicate the original source and this statement, thank you.







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.