Archive for April, 2013
Archived; click post to view. Excerpt: Every blogger knows that comment spam is such a pain. Akismet is good solution, but not always. Why not to block spammers, instead of mark them as spam or suspicious as a spam. The code below looks for HTTP reffere in the request header and blocks the comments if […]
Using PHP functions to find the directory and url of current script might give you wrong result. However, there is a better way in WordPress to find plugin directory and URL.
Archived; click post to view. Excerpt: Recently I had a task to cut off the piece of content from the post displaing on front page. To resolve it, the wordpress function get_the_content() is defined. In order to fully undestand what we are talking about, review next code: Using this method the html tags, which presented […]
To print out the post with specified field/value we have to find the main loop to display the posts and add query_posts() function, as showed below.
If in the current WordPress template the announcements are outputed by the_excerpt() function and the excerpt field is not filled, than we can watch the symbol […]. In order to get rid of this symbol, you would only need to insert next code in the functions.php of your theme.
Should you need to replace […] by link ‘Read More’, you would only need to create next function in ‘popular’ functions.php file.
Archived; click post to view. Excerpt: There may be a need for a special appearance of the first post (for example, when you need to make a completely different design from the other posts), whether the main page, the archives, search, etc. This problem is solved by adding the special CSS-class with a simple PHP-code. […]
Archived; click post to view. Excerpt: Sometimes we have a need to highlight the first post in loop of main page, archive page or search page and apply different style for it. This output can be implemented by using special CSS class and simple php code. Originally we have the regular loop to output our […]
Code for inserting your own content to every RSS Feed of WordPress based blog is very simple It can be usefull for inserting ads or banners. Include the code must in functions.php of your theme.
If for some reasons we have to exclude one or several categories from RSS, it can be done this way. Insert into functions.php next code.