Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,159,193 members, 7,839,061 topics. Date: Friday, 24 May 2024 at 01:10 PM

I Need Help With Wordpress Plugin - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / I Need Help With Wordpress Plugin (493 Views)

Where Can I Buy An Investment Script Compatible With Wordpress / Can I Build An Online School With Wordpress / PHP Programmer That Can Work With Wordpress Needed For A Project (2) (3) (4)

(1) (Reply) (Go Down)

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:

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.

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:
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

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:
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.
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:


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.

exactly
Re: I Need Help With Wordpress Plugin by cbrass(m): 9:20pm On Dec 29, 2020
etoluw:


It is easy to add custom link to Nav menu
programmatically ?
Re: I Need Help With Wordpress Plugin by Karleb(m): 9:28pm On Dec 29, 2020
cbrass:

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

I'm fine. cool

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:


I'm fine. cool

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.

hmmm..you have a point




Re: I Need Help With Wordpress Plugin by etoluw: 11:47pm On Dec 29, 2020
cbrass:
programmatically ?
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:


I think it is possible

let me do the research and get back to you
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:

Okay. Thanks bro
The idea is the plugin when installed will automictically show a link at the menu

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:


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

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 cheesy

modified
It worked bro. please see attached image.
Na oversabi won kill me, that was why it didn't work grin grin
Thank you ones again

Re: I Need Help With Wordpress Plugin by stanliwise(m): 11:54pm On Dec 30, 2020
cbrass:
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?
Are you willing to pay for the plugin?
Re: I Need Help With Wordpress Plugin by etoluw: 6:03am On Dec 31, 2020
cbrass:


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 cheesy

modified
It worked bro. please see attached image.
Na oversabi won kill me, that was why it didn't work grin grin
Thank you ones again

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:

Are you willing to pay for the plugin?

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)

Web Development Study Partner Needed / Please Help Me With Something To Eat to cool me off suicidal thoughts / Arduino Game Controller

(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. 22
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.