WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11660 closed enhancement (worksforme)

Custom code for any theme

Reported by: daniel.accorsi Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Themes Keywords:
Focuses: Cc:

Description

Create a new enhancement to developing new PHP/HTML codes independent of chosen theme. This can be used in cases that users and developers are changing the archives of theme to implement new functions, like a google code, etc. When changing the theme, these code will not be replaced by new chosen theme.

This can be applied by creating a new area in WPs administration and associating the custom code to the desired position in the blog (top, bottom, sidebar etc).

Change History (6)

comment:1 @sirzooro5 years ago

-1

I think it should be sufficient to create and use own plugin. You can put into it all your custom functions, hooks, etc. which you want, and you will have them available no matter which theme you use.

comment:2 in reply to: ↑ description ; follow-up: @nacin5 years ago

Replying to daniel.accorsi:

Create a new enhancement to developing new PHP/HTML codes independent of chosen theme. This can be used in cases that users and developers are changing the archives of theme to implement new functions, like a google code, etc. When changing the theme, these code will not be replaced by new chosen theme.

I am pretty sure you just defined a plugin here.

This can be applied by creating a new area in WPs administration and associating the custom code to the desired position in the blog (top, bottom, sidebar etc).

There is a plugins area in wp-admin. Here is your custom code association example:

function send_this_to_the_header() {
   echo "<!-- this is a test -->";
}
do_action( 'wp_head', 'send_this_to_the_header' );

comment:3 in reply to: ↑ 2 @janeforshort5 years ago

I am pretty sure you just defined a plugin here.

+1

comment:4 @nacin5 years ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

comment:5 @hakre5 years ago

  • Keywords theme code custom removed

comment:6 @hakre5 years ago

Thanks for creating an enhancement report. The suggestion you made should already be possible by coding a plugin. That is why this ticket has been closed (because that enhancement already exists).

If you feel that this is incorrect please provide more information about what you want to achieve. Thanks for your feedback.

Note: See TracTickets for help on using tickets.