Add file to media library programmatically


توسط: س سروش / در: ۲۳ آبان ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 177 بازدید

Adding Files to the WordPress Media Library

One thing that WordPress offers that manual uploads don’t manage is adding files – specifically media types – to the Media Library after uploading a file. This is relatively easy to do given media_sideload_image.   Say that the setup is something like this: You have files located on the root of the server You need to move the files to the uploads directory You need to add the files to the Media Library There are a number of reasons that files may exist on the server. Perhaps you don’t want to […]

توسط: س سروش / در: / گروه : کدهای وردپرس / ۰ نظر / 220 بازدید

Delete wordpress post revisions to reduce the db size

When you edit wordpress posts it automatically creates revision of the post. This is useful if you wanted to rollback to a previous version of the post. But a problem with this is it creates a record in database each time. This means it increases your database size. This won’t be a much issue for a small site with few posts. But when you have more posts and if you edit posts very often it will affect a lot for your site in the long run. Sometimes this will increase […]

توسط: س سروش / در: ۲۰ آبان ۱۳۹۵ / گروه : آموزش وردپرس, کدهای وردپرس / ۰ نظر / 185 بازدید

۳ easy steps that can make your wordpress login secure

Use a strong password A common mistake done by most site owners is using a weak password for the admin user account. This makes easier for hackers to find your password. Use a strong password mixed with capital letters, special characters and numbers. Password strength meter in latest WordPress release will help you to measure the strength of your password. Limit login attempts One way of hacking is to use an automated tool to do a dictionary attack. WordPress do not have any limit on login retry attempts. Therefore a […]

توسط: س سروش / در: / گروه : آموزش وردپرس / ۰ نظر / 200 بازدید

Setting a cron job to visit a url

Setting a cron job to visit a url January 22, 2013 by Sadupa Wijeratne – 4 Comments Cron jobs help to run a script on a given interval. You can set a cron job to visit a web page on a given time.  This article explains how to create a cron job easily in cpanel. First log in to cpanel and click the cron jobs button. In most cpanels this is in the Advanced section at the bottom. Then you will get the screen where you can set a cron […]

توسط: س سروش / در: / گروه : کدهای وردپرس / ۰ نظر / 173 بازدید

wp_pagenavi Custom Query

[crayon-5b500884c757a680136845/] [crayon-5b500884c7599319134184/]  

توسط: س سروش / در: ۱۹ آبان ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 201 بازدید

WordPress Image Custom size name


توسط: س سروش / در: ۱۴ آبان ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 159 بازدید

Load WordPress Post Content into DIV with Ajax and jQuery

I was recently playing around with a WP website where I wanted to show post content into a specific div element when a link (the post title in my case) is clicked, without having to refresh the page or going to an inner page. In order to do this, we have to use Ajax and jQuery. Here’s how you can achieve this neat effect step by step: Step 1: Use the following code where you want to display the post titles: [crayon-5b500884c8082015110972/] Basically, this code will display all post titles […]

توسط: س سروش / در: ۱۳ آبان ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 156 بازدید

WordPress How to Create Customize Registration Form


توسط: س سروش / در: ۹ آبان ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 187 بازدید

WordPress Get Between Date Posts

[crayon-5b500884c8fb9695260652/] And You Can Use  Post type to get other custom type posts LIKE: [crayon-5b500884c8fcb968574243/]

توسط: س سروش / در: ۶ آبان ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 196 بازدید

Turn on WordPress Error Reporting

Comment out the top line there, and add the rest to your wp-config.php file to get more detailed error reporting from your WordPress site. Definitely don’t do this live, do it for local development and testing. [crayon-5b500884c955f497948309/]

توسط: س سروش / در: / گروه : کدهای وردپرس / ۰ نظر / 178 بازدید

Get Custom Post Category Detail By ID


توسط: س سروش / در: ۴ آبان ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 176 بازدید

Coding and Registering Your WordPress Widget

[crayon-5b500884ca171634429693/] Creating the Widget Class The next step is to create a new class to extend the WP_Widget class. Type this code into your plugin file: [crayon-5b500884ca17c613508506/] Registering the Widget Your widget won’t work unless you register it with WordPress. Below your class, add the function and hook to do this: [crayon-5b500884ca19e662476811/]–cms-22404

توسط: س سروش / در: ۳۰ مهر ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 175 بازدید

WordPress Create Sidebar Widget

Put this code in functions.php and see theme->widget [crayon-5b500884ca71a630852894/]   How to Create a Custom WordPress Widget

توسط: س سروش / در: / گروه : کدهای وردپرس / ۰ نظر / 178 بازدید

Get the post thumbnail By ID

[crayon-5b500884cadd0579068161/] [crayon-5b500884caddb323356899/] [crayon-5b500884cade1809476654/]     Remove width and height attributes from the returning html get_the_post_thumbnail function produces html with img tag which includes width, height, src, class, alt and title attributes. The following code snippet is useful if someone wish to remove width and height attribute. This function provides 'post_thumbnail_html' filter before returning the html. [crayon-5b500884cade8682087230/]  

توسط: س سروش / در: ۲۹ مهر ۱۳۹۵ / گروه : کدهای وردپرس / ۰ نظر / 189 بازدید
صفحه 2 از 512345