How can I edit a default function on WordPress?

I should edit the dynamic_sidebar() function on wordpress (hiding some categories, editing the template).

Is it possible? I read “you need to edit the core”, but I don’t have understand where is this “core” 🙂

Related posts

Leave a Reply

3 comments

  1. Never edit the core. The reason is that if you change the default behaviour, themes you install might not work and updates to the wordpress engine will break your changes.

    To change the way your wordpress behaves, create a child theme. Then add a functions.php file and in it create a widget that has your desired behaviour.

    You can also register a new type of sidebar and a page templates that shows only that type of sidebar.

    See: http://codex.wordpress.org/Child_Themes and https://codex.wordpress.org/Function_Reference/register_sidebar_widget

  2. Personally, you sound like your just starting out so I will give you some advice. Never edit the core.

    It’s tempting for a quick fix. Everyone has done it when they didn’t know any better, but you have the opportunity to learn the right way.

    Approach your problem logically. What are you trying to edit it for? Hiding some categories? Use the internal widget system in the CMS and take them off. Delete the categories, or hide them with CSS {display:none;}.

    Good luck my young Padawan. I hope you take some advice and heed it well.

  3. Best way is to probably make a Child template using the plugin One-click child theme. Copy the file containing the function to the child template (using ftp) and edit it there. This way you can update your template and still keep your changes.