Опис
Додатак Head & Footer Code омогућава додавање прилагоћених исечака кôда (JavaScript, CSS, или HTML) на странице чак и ако нисте програмер, било да је то унутар <head>
(верификација веб места за различите сервисе, прилагођени стилови, мета или везе за веб словне ликове), одмах иза отворене ознаке <body>
(пиксели за праћење посетилаца, аналитику или топлотне мапе) или испред затворене ознаке </body>
.
Go to Tools → Head & Footer Code in WordPress Dashboard. Insert custom code to HEAD, BODY or FOOTER section (depending on what you have to do).
If your WordPress shows the latest blog posts on the homepage, you can also add specific code only for the homepage on Tools → Head & Footer Code (there will be section Head, body and footer code on Homepage in Blog Posts mode)
To insert custom code specific for individual article (post, page or custom post type), use article-specific Metabox while editing post/page/custom post type (check out Screenshots). There choose if that specific code appends to site-wide code defined on Tools → Head & Footer Code, or to replace it.
Од верзије 1.3.0 можете поставити кôд специфичан за категорију на свакој појединачној категорији.
Друге таксономије (ознаке и прилљгођене таксономије) нису подржане. а њих користите општа подешавања.
Ова магија се одвија копчањем на Вордпрес копче wp_head
, wp_footer
и wp_body_open
.
Various code snippets are supported, including but not limited to:
- Google Analytics
- Google Tag Manager
- Google Ads Conversion
- Lite Analytics
- Facebook Pixel
- Hotjar
- FullStory
- Google site verification
- Bing site verification
- Yandex site verification
- Alexa site verification
Функционално или неисправно?
If Head & Footer Code does not work on your WordPress project, please let us know by raising a new support ticket in the Community Forum and describe what does not works and how to reproduce the issue. We will make sure to resolve the issue as soon as possible.
If you find Head & Footer Code useful for your project, please review plugin.
Особине
- Поставите прилагођени садржај за одељак заглавља стране на целом веб месту (испред
</head>
) - Поставите прилагођени садржај за одељак тела стране на целом веб месту (иза
<body>
) – Захтева Вордпрес 5.2! - Поставите прилагођени садржај за одељак подножја стране на целом веб месту (испред
</body>
) - [НОВО у 1.2] Поставите специфичан прилагођени кôd за заглавље, тело и/или подножје на почетној старници уколико се на почетној страници приказују ваши блог записи
- [NEW in 1.3.1] Toggle homepage specific custom code on paged Homepage in Blog Posts mode (page 2, 3, a nd so on)
- Поставите прилагођени садржај за одељак заглавља стране специфичан за записе (испред
</head>
) - Поставите прилагођени садржај за одељак тела стране специфичан за записе (иза
<body>
) – Захтева Вордпрес 5.2! - Поставите прилагођени садржај за одељак подножја стране специфичан за записе (испред
</body>
) - [НОВО у 1.3.0] Постављање прилагођеног кôда специфичног за категорију у заглавље, тело и/или подножје странице
- Одаберите приоритет уметнутног прилагођеног кôда у одељке заглавља, тела и подножја (мањи број значи удаљеније од
</head>
и</body>
, односно ближе до<body>
; већи број значи ближе до</head>
и</body>
и даље од<body>
) - Одаберите које ће врсте записа имати омогућену подршку за прилагођени кôд заглавља, тела и подножја специфичног за уносе
- Одаберите да ли ће прилагођени кôд заглавља, тела и подножја специфичан за уносе бити додат иза кôда за цело веб место, или ће га заменити
- [НОВО у 1.2.1] На листама чланака, страница и прилагођених врста записа можете видети да ли унос има постављен неки специфичан прилагођени кôд
- Одељак за цело веб место се налази на Алатке > Head & Footer Code
- Уколико сте поставили константу WP_DEBUG у датотеци
wp-config.php
наtrue
, прилагођени кôд ће бити омотан ХТМЛ коментарима у изворном кôду стране. - Подржан је Multisite.
- PHP 8.2 ready!
General settings (HEAD, BODY, FOOTER global code and priority, Homepage code and behaviour) saves in WordPress option auhfc_settings
.
Each post/page/custom post type specific HEAD, BODY and FOOTER code and behaviour saves to post meta _auhfc
.
Each category specific HEAD, BODY and FOOTER code and behaviour saves to taxonomy meta _auhfc
.
This data deletes from the database on uninstall.
Снимци екрана
Картица додатка Head & Footer Code у резултатима претраге додатака Страница подешавања додатка (цело веб место, почетна страница и врсте записа) Мета одељак за прилагођени кôд специфичан за уносе Пример прилагођеног кôда уметнутог у одељак ЗАГЛАВЉА (кôд за цело веб место са додатим кôдом специфичним за уносе) Example of custom code inserted to BODY and FOOTER sections (site-wide with appended article specific) Мета одељак за прилагођени кôд специфичан за категорију Example of custom code inserted to HEAD section (site-wide with appended category specific) Example of custom code inserted to BODY and FOOTER section (site-wide with appended category specific) Example of Head & Footer Code column on Pages listing, to identify which pages have set custom code, which one and what mode is selected
Постављање
Installation of the Head & Footer Code is easy as any other WordPress plugin.
Стандардни поступак
- In WordPress Dashboard go to Plugins → Add New.
- Enter
head footer code
to the Search plugins… field and wait for the moment. - Locate Head & Footer Code and click the Install Now button.
- After successful installation, click the Activate button.
- Click Settings link for Head & Footer Code or visit the Tools → Head & Footer Code.
- Add the desired code to the target section.
ФТП поступак
- Click on the Download button to get Head & Footer Code installation package.
- Unpack archive head-footer-code.zip on local computer.
- Upload the entire directory head-footer-code to the
/wp-content/plugins/
directory on your server. - In WordPress Dashboard go to Plugins → Installed Plugins and click the link Activate for the Head & Footer Code plugin.
- Click Settings link for Head & Footer Code or visit the Tools → Head & Footer Code.
- Add the desired code to the target section.
ЧПП
-
Да ли су подржан ПХП кôд?
-
As it’s a security risk, the Head & Footer Code does not process PHP code if entered into any plugin field (global or article specific).
Any content added to HFC fields is printed on the front-end as is.
-
I entered code to BODY section, but nothing outputs on front-end
-
Ова особина је уграђена од ВордПрес издања 5.2 и захтева компатибилну тему.
To make sure if theme you use supports wp_body_open hook, open in code editor
header.php
file from theme you use, and check if right after opening<BODY>
tag there is following code (if it does not exists, add it or ask some developer to do that for you):`
if ( function_exists( ‘wp_body_open’ ) ) {
wp_body_open();
}
`
Прегледи
Сарадници и градитељи
Head & Footer Code је софтвер отвореног кода. Следећи људи су допринели овом додатку.
СараднициHead & Footer Code је преведен на 6 језика. Хвала преводиоцима за њихове доприносе.
Преведите Head & Footer Code на свој језик.
Заинтересовани сте за градњу?
Прегледајте код, проверите SVN складиште или се пријавите на белешку градње преко RSS-а.
Белешка о изменама
1.3.1 (2023-03-18)
- Tested: on PHP 8.1.14/8.2.1 and WordPress 6.2-RC2 with Twenty Twenty-Three theme (Single and Multisite)
- Add: support do not add homepage in Blog Post related code on paged pages (2, 3, and so on)
- Add: CodeEditor on textareas in article Meta boxes
- Fix: Fatal error due to relocated plugin update file
- Cleanup: Remove donate button from settings page
- Improve: Security.
- Improve: Coding Standard.
1.3.0 (2022-05-08)
- Tested: on PHP 8.1.5 and WordPress 6.0-RC1 with Twenty Twenty-Two theme (Single and Multisite)
- Add: Support for Categotry specific code.
- Improve: Coding Standard.
- Improve: Important notes on settings page.
- Improve: README converted to MarkDown.
- Improve: Remove PayPal logo and load minified admin stylesheet.
1.2.4 (2021-10-15)
- Tested: on WordPress 5.8.1 and PHP 8.0.9 and 8.0.11
- Improve: clarify within article metabox on how replace behaviour for article-specific code works
- (2021-08-23) Improve: along to FOOTER, enable processing of shortcodes in HEAD and BODY (you has to enable this opetion per location)
1.2.3 (2021-07-19)
- Tested: on WordPress 5.8-RC4 and PHP 8.0.8
- (2021-05-04) Fix: Notice errors Trying to get property ‘post_type’ of non-object in inc/front.php (thanks to @tekgirlymama)
- Improve: DRY for getting post type.
1.2.2 (2021-04-24)
- Tested: on WordPress 5.7.1
- (2021-02-01) Fix: Noice errors in update script (thanks to @swinggraphics)
- Improve: wording on post/page listing
1.2.1
- Додато: колона Head & Footer Code на списку чланака, страница и прилагођених врста записа ради приказа да ли је додат и где је додат прилагођени кôд специфичан за уносе
- Поправљено: in_array() expects parameter 2 to be array, null given in head-footer-code/inc/front.php on line 46, 111, and 176
1.2
- Додато: прилагођени кôд заглавља, тела и подножја на почетној страни у режиму приказа скорашњих чланака.
- Поправљено: Уређивач Кôда не ради од Вордпрес издања 5.5.
- Поправљено: неисправан захтев приликом чувања подешавања https://github.com/urosevic/head-footer-code/issues/1
- Унапређено: „не понављај се“ за услове фронта веб места.
- Унапређено: додати савети преводиоцима за комплексне ниске.
- Унапређено: све ниске су доступне за локализацију.
1.1.1
- Тестирано: на Вордпресу 5.4.1, 5.5-RC2-48768 са PHP 7.4.1
- Додато: видео запис са упутством за постављање, подешавање и употребу додатка Head & Footer Code
1.1.0
- Тестирано: на Вордпресу 5.1.4, 5.3.2 и 5.4-beta3 са PHP 7.2.15 и 7.3.7
- Поправљено: обрнуте косе црте се уклањају из кôда ЗАГЛАВЉА, ТЕЛА и ПОДНОЖЈА специфичног за уносе приликом чувања измена чланка/странице, пријавио @asherber (
update_post_meta
просчлеђује кључ и вредност доupdate_metadata
који очекује да садржај садржи додатне обрнуте косе црте) - Додато: подршка за копчу тела
wp_body_open
уведену у Вордпрес издању 5.2 - Додато: компатибилност за
wp_body_open
на старијим инсталацијама Вордпреса - Додато: ЧПП упутство за додавање подршке за
wp_body_open
у било коју тему - Ажурирано: везе и фразе на страни за подешавање додатка
- Ажурирано: снимци екрана
1.0.9.1
- Поправљено: кобна грешка на више-места (хвала @kunzemarketing за пријаву)
- Унапређено: „не понављај се“ за проналажење грешака на фронту
1.0.9
- Додато: описне врсте записа и описи за одељак кôда специфичног за уносе
- Додато: Опција за процесирање краткох кôдова у одељку ПОДНОЖЈА (опште подешавање за кôд на целом веб месту и кôд специфичан за уносе)
- Измењено: раздвојен приоритет за ЗАГЛАВЉЕ и ПОДНОЖЈЕ тако да управник може да одабере разлиите приоритете за заглавље и подножје
- Додато: CodeMirror уређивач кôда за ЗАГЛАВЉЕ и ПОДНОЖЈЕ у подешавањима додатка
- Додато: копча за укључивање додатка у циљу спречавања кобне грешке у случају застарелог Вордпреса или PHP
- Унапређено: безбедно учитавање
1.0.8
- Test compatibility with WordPress 5.1.1 and PHP 7.2.15
- Change: Meta boxes layout and type of behavior selector
- Change: Convert Post metaboxes to OOP
- Change: GNU GPL license to v3
- Add: Bundle GNU GPLv3 license to plugin codebase
- Ажурирано: снимци екрана
1.0.7
- Compatibility check: Tested for WordPress 4.7.1
- UX: Add right hand sidebar on global settings page with links to donate, FAQ, Community support and plugin Reviews page.
- UX: Set monospaced font for textareas on global settings and article pages
1.0.6
- Fix:
PHP Notice: Trying to get property of non-object in \wp-content\plugins\head-footer-code\inc\front.php on line 41
. - Fix: Overwrite footer content for post/page if post/page template after content have another WP Loop query (like recent posts WP Widget in RHS sidebar).
- Optimize: Avoid reading post meta if not singular or post type not enabled
- Tested in Multisite environment (main and other network websites) on WordPress v4.5-alpha-36504 and theme Twenty Sixteen v1.2-alpha.
1.0.5
- Enhance: Add uninstall routine to make some housekeeping on plugin removal.
- Enhance: Add post type in debug comments.
- Readme: Test on WordPress v4.4-beta1 and updated compatibility.
1.0.4
- Fix: PHP Warning: in_array() expects parameter 2 to be array, string given (introduced in v1.0.3)
1.0.3
- Change: Make even default WP post types
post
andpage
optional for page specific head/footer code
1.0.2
- Change: Replace PayPal donation links to prevent account limitations if plugin is used on website that violates PayPal’s Acceptable Use Policy
1.0.1
- Fix: PHP Notice Trying to get property of non-object
- Optimize: Remove
attachment
post type from available to select as no reason to have custom head/footer code on attachments - Optimize: Settings code cleanup
1.0.0
- Почетно издање.