Modify wordpress pages widget and turn it into a plugin? - wordpress

I would like to make a plug-in that adds a widget in wordpress.
I would like the widget to be based on the current pages widget but add the ability to select either include OR exclude by drop down or checkbox then list pages by ID.
Following this guide I was able to change the exclude to include by hacking the core file located in wp-includes/default_widgets.php.
Here is the original default_widgets.php:
http://pastebin.com/Rg2vTMmK
How do I make the changes and turn it into a plugin?
Many Thanks

Found a solution here: http://wordpress.org/extend/plugins/widgets-reloaded/

Related

How to create such buttons with Wordpress?

I'm very new to WordPress (tbh, it's my first time working with it). And I need to make a website as my school project using CMS. Creating pages with templates is alright, but I have a lot of troubles with buttons. I found this website, and I can see it using WordPress. I need such buttons as on this page https://movie-chooser.co.ua/random-movie-2/ (they appear when you hover over the image). Is this a default option for buttons in WordPress? If not, is there a plugin for this or what is the way to add them on my images?
First Install Elementor plugin https://wordpress.org/plugins/elementor/
and go to page when you add button and open page with elementor
and do drag and drop any element like button, space, text editor etc.
You have several ways to achieve that:
Overwritting Wordpress CSS
Using a plugin
Create your own shortcode
1 - Overwriting Wordpress CSS
If you manage to display all the elements using wordpress template, and your only issue is to display buttons over the images, then it should only be a matter of CSS
2 - Using a plugin
The idea here is to find a plugin that help you to create/display the informations you need (maybe you'll need to add functionnality to basic post though custom fields or using a custom post type).
Once you find the right plugin, again if the plugin dosen't directly offert some settings on the design then you'll have to overwrite the plugin's CSS rules to display the elements as you want.
3 - Create your own shortcode
If you're new to Wordpress I wouldn't recommend this method as it is kind of advanced, unless you're comfortable with PHP/HTML/CSS (optionaly JS).
This is the more flexible solution as you can basically control anything, but it will require you to understand some core concepts of Wordpress like WP Query and how custom queries works.
The idea here is to create a shortcode.
THis shortcode refere to a custom made PHP function, in which you can create a custom request to fetch the informations you need to display from Wordpress database, and display it in an HTML structure that you decide.
THen angain, you'll just have to customize it though CSS.
Note : no need to create a whole plugin if you decide to create a shortcode, you can use the template functions.php file for that.

Migrating custom code from one theme to another

I have custom code for custom woocommerce fields added to child theme of current theme. Everything works as it should. There are hundred of products already on site with those fields filled. Now I want to switch to another theme. My questions are:
Is it safe to just copy custom code to child function of another theme?
Is it better to copy it to plugin?
I need all entered values to stay in database and on frontend and without duplicate fields. Thank you in advance.

How to create a public custom WordPress widget

I want to create a widget for WordPress that anybody can use (for free) which contains some entertaining content (like a gadget for iGoogle in earlier times).
What I did not find out:
Can a (custom) widget be public/listed, so everybody using WordPress can see and use it?
Or do I need to create a plugin in order for other WordPress users to see and use it?
Since I want to let the users decide, where to put this additional content, how can I achieve this? (i.e. integrate this widget behaviour into a WordPress plugin?)
The basic idea is that we have some interesting content, we want to spread on WordPress for free.
It's up to you wether you want to create you widget through you theme (eg: via functions.php) or via a plugin. If you would like everyone to use it independently from a theme, then the best idea would be to do it through a plugin.
Here is a simple tutorial that explains the pieces of code you need to include either in your theme or in a new plugin to create a Widget accessible via the WordPress's widgets panel: http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget

Delete Site from Archiv Widget

I created a Page in WP and i found it in the Archiv-Widget.
Is there a way to create a Page and don't show it in the Archiv?
I use WP 3.0.5
There isn't a way of excluding items using the built-in archive widget, unfortunately.

Wordpress - hardcoding subscribe2 (or any other plugin) widget into template

I know how to hardcode categories, archives, etc into theme but for one of my projects i would have to hardcode some plugins widgets (especially subscribe2) and i'm not sure how to do this. I know i can add widgets via widgets menu in wp admin, but that's not what i'm trying to achieve, i'm trying to set it up permamently in theme for later reuse. How to do this? Especially with subscribe2?
You can add the widget via the normal means, and check the code on the site using View->Source.
Then, you need to edit the html template for the theme (depending on where you want the widget to appear - main entry, sidebar.html, etc) and add the code there directly.

Resources