Description Banner advertisements are a great way to maximize your ad revenue by displaying them on different pages across various locations. While there is no direct WordPress action hook or filter function that allows you to add new features like banner slider near the header and footer, or in any other good place, admin users/site managers can change and add plugin PHP code to allow site owners to display advertisement slider on the front end site visitors. Important Note: To display an advertisement slider on the user end, you must edit the header.php and footer.php files of the current active theme. If you do not have knowledge of PHP or WordPress code, we will guide you on how to add screen images from the admin—>Plugin Settings—>Document. Live Demo You can find a live demo of a banner slider display on different pages plugin on our site. Different between Banner Slider and other slider plugins A normal slider plugin displays banners via widgets or shortcodes only for limited areas. However, with a banner slider plugin, you can add multiple banners on any page or post. This makes it easier for you to showcase your products or services to more people. The banner slider plugin offers a unique feature that allows for the display of banners on various pages, including home, category, tag, and search pages. Each page has its own unique layout, with options to display banners either above or below the header and footer. This plugin’s primary goal is to enhance the advertisement display opportunities on your site, thereby increasing the number of advertisements available and potentially boosting revenue. One of the main features of this plugin is the ability to use it as both a single banner or a gallery slider. This flexibility allows you to tailor the appearance of the banners to suit your site’s aesthetic and user experience. The plugin also supports screen touch slider functionality, allowing users to interact with the banners in a more intuitive manner. To further enhance the user experience, the plugin allows for up to five advertisement banner images per slider. This provides ample space for visually appealing ads that will catch the attention of visitors. Additionally, the plugin supports displaying multiple banners (either as individual images or as a gallery) and/or a single banner. The banner slider can be positioned above and below the header and footer of each page, ensuring that it is always visible to users. This feature makes it easy to showcase important information or promotions without disrupting the flow of the website. Banner slider placement is particularly useful on the homepage, where it can serve as an eye-catching feature that draws visitors in and encourages them to explore other pages on your site. Similarly, it can be beneficial on category pages, where it can showcase featured products or services. In summary, the banner slider plugin offers a versatile solution that allows for customizable ad displays across different pages on your site. By increasing the number of advertisements available and improving user engagement, this plugin can help drive more traffic and revenue to your website. Banner Slider for Post Tag Pages:
- Displays a banner slider in the header and footer of post tag pages. Banner Slider for Search Page:
- Includes a banner slider in the header and footer of the search page. Banner Slider Widget:
- Allows you to display the banner slider at any widget area directly. Banner Images with Click Link URL:
- Adds an option to include clickable link URLs in the banner images. Banner Slider Pagination & Navigation (Previous/Next):
- Offers a banner slider pagination and navigation feature, including the option to navigate between previous and next slides. Banner Slider Auto Play/Auto Slide:
- Enables auto play or automatic slide functionality for the banner slider. Banner Slider Infinite Loop:
- Supports infinite looping, allowing the banner slider to cycle through its content without stopping. Adjust Banner Slider Height as per Banner Images:
- Provides the ability to adjust the height of the banner slider based on the size of the banner images. Fix Slider Width & Slide Time Settings:
- Fixes the width of the banner slider and provides options to adjust the slide time settings. Banners for Mobile Show/Hide:
- Ensures that banners are shown or hidden on mobile devices. Slider Effects:
- Offers default and fade effects for the banner slider. Responsive Design:
- The banner slider is responsive and scales according to the device screen size. WordPress Multi-site Ready:
- The plugin is compatible with WordPress multi-site environments. Mobile Friendly:
- Makes the banner slider mobile-friendly for easy viewing on smaller screens. Live Demo:
- You can find live demos of the banner slider display across various pages on our website. How Many Places Display Advertisment Banner Slider:
- Shown above the header, below the header, above the footer, and below the footer on various pages. On Which Pages Display Advertisment Banner Slider:
- Displayed on the homepage, both above and below the header and footer. Category Pages — Above & Below Header and Below Footer Tag Pages — Above & Below Header and Below Footer Search Page — Above & Below Header and Below Footer How to Display Banners on Front-end Site Why You Should Edit Header.php & Footer.php Files? This is the only big question, and the answer is: every WordPress theme and child theme header.php & footer.php files have different HTML designs, so we cannot say that any one can add code exactly on a particular line or near a particular code. Even not sure that the WordPress theme you are using has added an action hook for header.php & footer.php file. Step-by-step way to add banner slider code and update files. Go to WordPress admin -> Banner Slider (new menu added) -> Plugin Settings -> Document Settings. See settings for displaying banner ABOVE and BELOW header. Add the WordPress php hook code in “header.php” file. 在WordPress中,可以通过添加一个自定义的插件来实现在前端显示横幅广告的功能。以下是一个简单的步骤指南:
- 创建一个新的WordPress插件。打开你的文本编辑器(如Visual Studio Code或Sublime Text),然后创建一个名为“BannerSliderAd”的新文件。在这个文件中,你可以编写插件的核心功能和代码。
- 在“footer.php”文件中添加以下代码:
<?php
/**
* The sidebar that will be used for displaying banners on the front-end site.
*/
$banner_slider_before = 'wpw_banner_slider_before_header';
$banner_slider_after = 'wpw_banner_slider_after_header';
// Display banners advertisement slider in sidebar or any widget area by drag & drop widget: “Banner Slider Advertisement”
do_action( $banner_slider_before );
?>
这段代码将定义一个自定义的侧边栏,用于在前端显示横幅广告。你可以在这个侧边栏中添加一个“Banner Slider Advertisement”的拖放式广告容器。
- 在“footer.php”文件中添加以下代码:
<?php
/**
* The footer that will be used for displaying banners on the front-end site.
*/
$banner_slider_before = 'wpw_banner_slider_before_footer';
$banner_slider_after = 'wpw_banner_slider_after_footer';
// Display banners advertisement slider in sidebar or any widget area by drag & drop widget: “Banner Slider Advertisement”
do_action( $banner_slider_before );
?>
这段代码将定义一个自定义的底部区域,用于在前端显示横幅广告。你可以在这个底部区域中添加一个“Banner Slider Advertisement”的拖放式广告容器。
- 确保你已经激活了自定义的插件。在你的WordPress仪表盘上,点击“Plugins”选项卡,然后找到你刚刚创建的“BannerSliderAd”插件。点击“Activate”按钮来激活它。
- 最后,确保你的网站已经加载了自定义的插件。刷新你的网站,你应该能看到一个自定义的侧边栏和底部区域,用于显示横幅广告。 通过以上步骤,你就可以在WordPress网站上显示自定义的横幅广告了。如果你需要进一步的帮助或定制,请随时与我们联系。 要在前端网站上显示横幅滑块,有两种方法:
- 编辑header.php和footer.php文件,在header和footer上方及下方添加相关的动作钩子。
- 使用名为“Banner Slider Advertisement”的插件,通过拖放将其添加到小部件区域并显示滑块。 前往WordPress管理界面->Banner Slider(新增菜单)->插件设置->文档设置。 查看用于显示横幅的选项,包括在header上方和下方以及footer上方和下方。 在header.php文件中添加WordPress PHP钩子代码。 对于header上方的代码:do_action(‘wpw_banner_slider_before_header’); 对于footer下方的代码:do_action(‘wpw_banner_slider_after_footer’); 在footer.php文件中添加WordPress PHP钩子代码。 对于footer上方的代码:do_action(‘wpw_banner_slider_before_footer’); 对于footer下方的代码:do_action(‘wpw_banner_slider_after_footer’); 通过拖放“Banner Slider Advertisement”插件,将滑块广告显示在侧边栏或其他小部件区域。 在WordPress中,通过使用“Banner Slider Advertisement”插件,可以在准备好的侧边栏中显示横幅广告轮播。只需将该插件从WordPress后台拖拽到“Widgets”菜单下的“Banner Slider”部分即可。 接下来,您需要选择由WordPress后台创建的横幅广告轮播。该轮播将根据设置显示,并且不需要额外的设置。只需简单地拖拽并选择横幅,操作即完成。 若要编辑header.php文件并添加横幅显示代码,请按照以下步骤操作:
- 进入WordPress后台。
- 点击左侧菜单中的“Banner Slider”(左)选项。
- 在插件设置页面中,找到“Document”(标签)部分。
- 点击“See & copy code”,然后粘贴以下代码:
do_action(‘wpw_banner_slider_before_footer’);
do_action(‘wpw_banner_slider_after_footer’);
其中,wpw_banner_slider_before_footer和wpw_banner_slider_after_footer是自定义动作函数的名称。
- 保存更改。 要编辑footer.php文件并添加横幅显示代码,请按照以下步骤操作:
- 进入WordPress后台。
- 点击左侧菜单中的“Appearance”(左)选项。
- 在主题设置页面中,找到“Themes”(标签)。
- 点击“Get Current Active Theme”,然后在弹出的窗口中查找与当前活动主题相关的文件(通常是theme-name.php)。
- 在theme-name.php文件中,添加以下代码:
do_action(‘wpw_banner_slider_before_footer’);
do_action(‘wpw_banner_slider_after_footer’);
确保将wpw_banner_slider_before_footer和wpw_banner_slider_after_footer替换为您之前在header.php文件中定义的动作函数名称。
- 保存更改。 现在,您的WordPress网站应该已经成功添加了横幅广告轮播功能。 要编辑WordPress网站的底部横幅,请按照以下步骤操作:
- 打开WordPress管理界面。在左侧菜单中选择“外观”选项。
- 在“外观”菜单下,找到“编辑器”链接,只有管理员和超级管理员用户才能看到此链接。点击进入编辑器。
- 在编辑器中,找到并选中当前活动的 theme。
- 在顶部搜索栏中输入“footer.php”,然后按Enter键。这将显示一个名为“footer.php”的文件。
- 点击“footer.php”文件,使其进入编辑器状态,以便您可以在其中进行编辑。
- 查找footer的开始代码。大多数情况下,它应该是类似于“
- 在footer.php文件的开头添加footer banner代码。您可以将其添加到文件开头或适当位置,如文件开头。
- 查找footer的结束代码。大多数情况下,它应该是类似于“……”(参见文档标签图像以获得更多理解)。
- 在footer.php文件的结尾处添加footer banner代码。您可以将其添加到文件结尾但位于body结束之前的位置。