Stats: 3,188,967 members, 7,936,089 topics. Date: Saturday, 31 August 2024 at 12:32 AM |
Nairaland Forum / Science/Technology / Programming / I Need Help With Wordpress Plugin (542 Views)
Where Can I Buy An Investment Script Compatible With Wordpress / PHP Programmer That Can Work With Wordpress Needed For A Project / Good In PHP & Familiar With Wordpress, Come Quick For A Mini Job (2) (3) (4)
I Need Help With Wordpress Plugin by cbrass(m): 6:51pm On Dec 29, 2020 |
Hello, i am trying to create a wordpress plugin that will automatically create a link on the homepage. My first try is to want to add the link no the Nav menu so that it can show in the navigation but that didn't work. I also tried to show it at the header using WP_head() but it just creates the link far above the website logo and menu. (Please see fig1) I really need help to know where i can access on the home page to create this arbitrary link, or is it even possible?
|
Re: I Need Help With Wordpress Plugin by Karleb(m): 7:45pm On Dec 29, 2020 |
Maybe if you look inside header.php, there might be functions you can hook into that'll display the content right where you want it. Long time Bros. |
Re: I Need Help With Wordpress Plugin by etoluw: 8:19pm On Dec 29, 2020 |
go to the "front-page.php" file you'll find where to put it. if your theme does not have "front-page.php" put it in the "home.php" file |
Re: I Need Help With Wordpress Plugin by etoluw: 8:23pm On Dec 29, 2020 |
cbrass: It is easy to add custom link to Nav menu |
Re: I Need Help With Wordpress Plugin by Karleb(m): 8:49pm On Dec 29, 2020 |
etoluw: I guess what he wants is automatic inclusion of the content in the header. As in, immediately he activates the plugin, the content will be added automatically to any theme in use. 1 Like |
Re: I Need Help With Wordpress Plugin by cbrass(m): 9:16pm On Dec 29, 2020 |
Karleb:you know iit is supposed to be a plugin that will be installed by a user who doen's know what to do, so if you ask them to go mess with the code it may be tedious for them. How are you doing bro |
Re: I Need Help With Wordpress Plugin by cbrass(m): 9:18pm On Dec 29, 2020 |
Karleb: exactly |
Re: I Need Help With Wordpress Plugin by cbrass(m): 9:20pm On Dec 29, 2020 |
etoluw:programmatically ? |
Re: I Need Help With Wordpress Plugin by Karleb(m): 9:28pm On Dec 29, 2020 |
cbrass: I'm fine. ![]() What I mean is, there should be an action hook you can hook into inside the header.php. Presently you're grabbing and hooking into the whole header.php, but inside this file there should be an action/filter hook you can hook to display your content exactly where you want it since there are a lot of hooks in wordpress. |
Re: I Need Help With Wordpress Plugin by cbrass(m): 9:58pm On Dec 29, 2020 |
Karleb: |
Re: I Need Help With Wordpress Plugin by etoluw: 11:47pm On Dec 29, 2020 |
cbrass:I think it is possible let me do the research and get back to you |
Re: I Need Help With Wordpress Plugin by cbrass(m): 12:38am On Dec 30, 2020 |
etoluw:Okay. Thanks bro The idea is the plugin when installed will automictically show a link at the menu |
Re: I Need Help With Wordpress Plugin by etoluw: 1:19am On Dec 30, 2020 |
cbrass: follow the advice below and let's see if it will solve the problem. https://wordpress.stackexchange.com/questions/121309/how-do-i-programatically-insert-a-new-menu-item |
Re: I Need Help With Wordpress Plugin by cbrass(m): 1:50am On Dec 30, 2020 |
etoluw: i have actually tried something similar before but my menu wasn't showing again. but this link you sent seems different. I will let you know if it works. I am grateful brother. May the good Lord bless you ![]() modified It worked bro. please see attached image. Na oversabi won kill me, that was why it didn't work ![]() ![]() Thank you ones again
|
Re: I Need Help With Wordpress Plugin by stanliwise(m): 11:54pm On Dec 30, 2020 |
cbrass:Are you willing to pay for the plugin? |
Re: I Need Help With Wordpress Plugin by etoluw: 6:03am On Dec 31, 2020 |
cbrass: glad to hear that but I think that link would appear on all the menus registered in the theme. maybe you should create a settings page where the user can select the particular menu he wants the link to be added to 1 Like |
Re: I Need Help With Wordpress Plugin by cbrass(m): 7:25am On Jan 01, 2021 |
stanliwise: i have done it already |
Re: I Need Help With Wordpress Plugin by Xxpress(m): 10:53am On Jan 01, 2021 |
What's the best web hosting to use for WordPress? |
(1) (Reply)
Check Out Me Personal Portfolio HTML 5 Template / Php Wahala / Software Engineer Please Urgent
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 26 |