UPDATE FROM ver 1.x to 2.x NOTE:
Following page selectors have been removed: All Posts, All Pages, Category Pages and Tag Pages.
Inserts that used them will not work. But don’t worry, just recreate «Insert» and «Exclude» rules and they will work again!
- Check minimal system requirements: WordPress 2.8.0, PHP 5.1.0.
- Download plugin.
- Unzip and upload `q2w3-inc-manager` folder to the `/wp-content/plugins/` directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- On the ‘Plugins’ menu in WordPress click ‘Deactivate’ plugin link.
- You will be redirected to the page with two options:
- ‘Deactivate plugin’ — for simple plugin deactivation. Use it for temporary plugin deactivation if you plan to use plugin in future.
- ‘Deactivate plugin and delete all settings from database’ — for complete plugin deactivation. All data associated with the plugin will be deleted from database.
Working with plugin
First of all go to the plugin setting page.
To begin creation of your Include click ‘Create new’ button. Include options window will appear.
Let’s see what are the meanings of all those options:
- Description. A shot description of your code. Something like ‘My banner’ or ‘Google Analitics’.
- Status. There are two options:
- Active. Include code will be shown.
- Disabled. Include code will not be shown.
- Location. Here you can select area of the page where your code will appear. Possible locations are:
- Footer (bottom of the page). Suitable for placing any type of code. For expample this is a right place for Google Analitics code.
- Before page content (before WP loop). Suitable for any types of advertisement.
- After page content (after WP loop). Suitable for any types of advertisement.
- Before post content. Suitable for any types of advertisement.
- After post excerpt (since version 2.0.0).
- After post content. Suitable for any types of advertisement.
- Widget. Suitable for inserting advertisement blocks to the sidebar. Widget must be activated on the Appearance->Widgets page.
- There is a sub option for Widget location — Widget title. This title is only for public pages. If no title provided, only widget include code will be displayed.
- Manual. This option allows you to place php function directly in your theme file.
- Shortcode. Insert code inside page or post content.
- Priority. This field determines display order of the includes placed in the same location. Field value must be integer. Includes with equal priorities are sorted by creation time. Newer includes will be displayed after older. If you set priority to 0 or leave it empty, after saving include priority value will become equal to 100. This is done to create include with priority ‘always first’ and ‘always last’. To make include always first set priority to 1 and make sure that there are no other includes with this priority in the same location. To make include always last set priority higher than 100 (for example 1000). Now all new includes with undefined priority will be placed between ‘always first’ and ‘always last’.
- Include on. Here you can select pages where your code CAN be shown. To select multiple pages or deselect page hold CTRL key. WordPress pages, posts pages, categories pages and tag pages can be selected one by one. Also there are several special page selectors:
- All. That means all public pages.
- Front page. Whether it is posts or a Page. Sub pages also belong to the front page. To exclude subpages select `Paged pages` in Exclude on section.
- WP pages. These are WordPress Pages, not any generic webpage from your blog.
- Posts pages. All post pages.
- Date pages. These are all date-based archive pages (i.e. a monthly, yearly, daily or time-based archive).
- Category pages. All Category archive pages.
- Tag pages. All Tag archive pages.
- Author pages. All author pages.
- Attachment pages. All attachment pages.
- Paged pages. All pages being displayed as «paged». This refers to an archive or the main page being split up over several pages. Only second and subsequent pages are considered «paged». This does not refer to a Post or Page whose content has been divided into pages using the nextpage QuickTag.
- Search page. Any search result page.
- Preview page. Single post page displayed in Draft mode.
- Page 404. Paged displayed when ‘HTTP 404 Page not found’ error happens.
- Exclude on. Here you can select pages where your code CANNOT be shown. Multiple select can be done by holding CTRL key.
- Hide from admin. Since version 2.0 this option upgraded to Hide from user. Now you can specify user groups to hide code from.
<?php /* php open tag is required */ echo 'WP variable: '; print_r($GLOBALS['wp']); /* php close tag is not required */
<h1>Hello!</h1><?php echo 'PHP!' ?><h2>Bye!</h2>
- Sub option Align (since version 1.1.0). Allows you to set horizontal align of the included code. Useful for aligning Google AdSense blocks.
A few words about settings page interface.
You can select table columns which will be displayed and can change number of table rows per page. To do this go to Screen options menu.
Also if Include options window is taking to much place you can minimize it by clicking on the window top bar (see screen shot above).
Frequently Asked Questions
How many Includes may I create?
The number of Includes is unlimited.
What is ‘Widget title’ option?
This option allows you to specify widget title for public WordPress pages. It will be displayed like Categories or Tags widget titles.
If you leave this option blanc, widget will be displayed without title.
I have set priority to 0 or left it blanc, but after saving it equals 100. Why?
This is done to help you create Include with priority ‘always first’ and ‘always last’. To make Include always first set priority to 1 and make sure that there are no other includes with this priority in the same location. To make include always last set priority higher than 100 (for example 1000). Now all new includes with undefined priority will be placed between ‘always first’ and ‘always last’.
Why Widget and Manual Includes priority is always 100 and I can’t change it?
Widget and Manual Includes don’t use priority number for sorting. Don’t worry about it.
In wich order sorted Includes with equal priorities?
Equal priority Includes are sorted by creation time. Newer includes will be displayed after older.
Added ability to insert shortcodes in comments. Option must be enabled in Code Insert Manager -> Settings page
Added support for Custom Post Type Archive pages
Fixed small bug with Opera multiple select
Fixed conflict with Find and replace plugin (Guys, why are you creating new user instance each time?!?).
Added German translation
Post Formats are now available for page filters
To admin page added search form and capability to filter table by status (Active/Disabled)
Plugin renamed to Code Insert Manager
Added support for custom post types (support for each post type must be enabled on plugin settings page)
Added support for custom taxonomies (support for each taxonomy must be enabled on plugin settings page)
Added new insert location — After post excerpt
Hide from admin option is upgraded to Hide from user
Admin menu entry moved to top level
Added French translation.
Added new location — shortcode
Fixed php evaluation error in Manual include mode
Plugin was successfully tested in WordPress 3.0
Improved page detection on themes with modified loop.
Fixed high memory usage on blogs with large number of posts/categories (more than 1000)
Fixed broken links (in plugin settings page) when WordPress installed in a subdirectory.
Fixed errors in WordPress MU.
New. Includes with PHP code now supported.
New. Align option added.
Fixed ‘Create New’ button malfunction in Opera and Firefox.
Fixed ‘Parse error: syntax error, unexpected T_PROTECTED in /htdocs/wp-content/plugins/q2w3-inc-manager/q2w3-table/q2w3_table.php on line 736’.
First public release.
Other Q2W3 plugins:
161 ответ к “Code Insert Manager (Q2W3 Inc Manager)”
Will there be an update in the near future?
[15-Jan-2018 14:02:54 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; q2w3_inc_manager_widget has a deprecated constructor in /www/htdocs/w0174798/[domain]/wp-content/plugins/q2w3-inc-manager/q2w3_inc_manager_widget.php on line 5
[15-Jan-2018 14:02:54 UTC] PHP Notice: Die verwendete Konstruktor-Methode für WP_Widget in q2w3_inc_manager_widget ist seit Version 4.3.0 veraltet! Verwende stattdessen __construct(). in /www/htdocs/w0174798/[domain]/wp-includes/functions.php on line 3901
Thanks for your plugin, it’s very useful.
I tried to include a custom PHP inside a shortcode but it doesn’t display nothing in front.. I don’t know why.
Here my PHP code:
I want to show the number of posts published.
Can you help?
Here my code (it didn’t display well in my previous comment:
You forgot to echo $published_posts!
I tried to include echo everywhere but it still don’t work . (I’m don’t speak PHP at all but I need this counter). Can you please show me the full code?
If it is not working, check $count_posts variable with var_dump($count_posts);
It’s acctually working perfectly, thank you very much!
wordpress 4.7 / q2w3 2.3.3
he same name as their class will not be constructors in a future version of PHP; q2w3_inc_manager_widget has a deprecated constructor in /var/www/web33/html/fachkraeftesicherer/wp-content/plugins/q2w3-inc-manager/q2w3_inc_manager_widget.php on line 5
How can i solve the problem?
I created a header code insert, with just one category at «insert on pages». I supposed that it would place that code on all pages within that category but seems that it just places it at that category’s index page. Am I missing something? How could do It to get all pages below that category injected with that code?
Thank you in advance
Hi when I try and save my FB Conversoin Pixel code it takes me to a 404 Not Found website on my page and the Insert is not saved.
would it be possible to insert code via child theme function.php?
May in this position?
may a search function is helpful to seach through places to hook in.
many thanks very good/usefull plugin.
Tobias from germany
The plugin designed to insert code to public pages only. function.php — is not a page, just a php file. Use editor to insert code there )
If you need to execute some code on all pages, use header or footer locations. Just insert php code without output!
When I go to insert on page only my website comes up not the list of pages. So it won’t work.
I love this plugin, makes inserting codes so easy. But on my settings page the following error messages appear. What do they mean and what should I do about them?
You need to turn off WP_DEBUG in wp-config.php:
I don’t think my insert into page works because I have 3.9 wordpress. When I click on insert page all I get is my website I don’t get a list of pages to insert into.
Unfortunately I can neither use nor uninstall this plugin… Why ?
(message : Forbidden — You don’t have permission to access /wp-content/plugins/q2w3-inc-manager/q2w3-table/q2w3_post.php on this server.)
It looks like your web server is blocking access to /wp-content/plugins/q2w3-inc-manager/q2w3-table/q2w3_post.php file.
Check mod_security rules!
I’m quite new to this. Please can you tell me if it’s possible to use Code Manager to change the font size on my Custom Menu widget?
Well… You don’t need any plugin to change theme styles… You need to edit style.css file of your theme
Ha! Ok, thanks — I think I understand this a little better now. Btw I have used Code Manager successfully to modify footers, very nice! Thanks again :-)