Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Buddypress add custom unordered list item in menu WordPress


I've figured out my own solution for the previous question so i figured i'd ask for a more simpler request. I'm using buddypress and i've created a custom menu within menu options and have added the custom menu in a widget. I'd like to register this new menu and attach a custom<li>content</li> as the first item in menu. Ideally i'd like to add in a search bar in this area but for now this will work. I've had issues when attempting to add a custom list item in the buddypress menu items.

Answers (2)


Ian Lincicome answers:

not to be argumentative, but I am sure you can;-) it might not be easy, but anything is possible if you give it an honest try and know what you are doing. I am 99% sure I can come up with a solution, but need to know a couple things:
1) will the iframe be called from the same domain/site?
2) why an Iframe? What you want done sounds like it might be able to be done within a normal div.
...more than likely I would have to access your site to implement a solution, but am sure it can be done one way or another, so let me know if u care to collaborate. -Ian


Andrea P answers:

you could use this little plugin which I made some time ago for a client.
it will create a new post type called "no layout" and you can use it to create pages that won't have footer nor header nor other normal divs.
it will just append the content of the post within one main div into the page body.

you also have a couple of options for the width of the container (so you can set it to match the width of the iframe that you'll be using), and background colour of the page.

paviod comments:

Appreciate it but i'm not looking to create a new template to assign to the page. I want to maintain the page with the header / footer and only remove it when it's loaded in an iframe.

Andrea P comments:

you can create another page placing the same content, and then use this new one for when you load it in the iframe, and the other one for when you don't load and you want it to display with the header and footer..

there is no way that a page can "know" if it is being viewed through an iframe or not. your idea is just not feasible.

as well as the other ideas of redirecting after login. after the login, whatever is set to redirect to, it will open inside the iframe.

Andrea P comments:

it's is a complex concept I know, but an iframe is not something placed into the site where you put it.
it is a window from where you can look at another page, as if it was opened inside another browser's window.

so, whatever happens into an iframe, stay into the iframe, as if you were doing it into another browser window. you can navigate wherever you want starting from the first page displayed in an iframe, and everything will open inside that iframe.

what the main page can do, is just watch. there is no way to communicate between what's going on inside the iframe and what is outside it.

paviod comments:

My first thought was to call the iframe in jquery and assign a new css call to "hide" the header and footer on the page. Shouldn't that be possible?

Andrea P comments:

no I am 99% sure that you can't.

because your jquery within the page won't be able to target the outside iframe, because it's something outside the DOM.

and the page where you place the iframe code, won't be able to "read" (and definitely not to "act") inside the page viewed from the iframe, because that page can only be watched from the iframe, as if you were looking from a keyhole..

Andrea P comments:

to answering @Ian

I know that there is always a possible solution, especially if we consider changing a bit the structure that he has at the moment.
in any case I am definitely sure that all the effort and the code required to achieve what he was asking by using his iframes structure, wouldn't worth and would result in a messy structure.
in particular, your second point is the real solution here. trying to understand what he really need and how a smart developer would achieve that by following standards and good practices. but that wasn't the question and was definitely worthing more than $20.

regarding @pavoid new question.

I am sorry but I'd be argumentative here.
I don't know if it's allowed by the rules, but I think is totally unfair and unprofessional to completely change the topic of the question after a day of discussing about it.
if you actually came up with a solution you should have closed this question and asked for a refund, which would have been given away only in the case that you actually found a solution and you can prove it.

I think that my plugin have pretty much covered the previous question. and if it wasn't the plugin, it definitely was the chat we had, that made you understand that the iframe structure that you got in mind was not the right approach and had to be changed.

in any case, if you thought that my answer were not worthy of the $20, you should have asked for a refund and then opened another question for the other thing about the buddypress menu.

because of this lack of professionality and because of the vague and messy information that you provided before and now, that made (and would again) me spend time. I'm sorry but I won't lose any more time with you.

whish you good luck

paviod comments:

Andrea i made it clear right away that your solution of changing the template was not what i was asking for. In addition, this was something you had already done up for a previous client so I apologize if your past work didn't work for me. To be honest, this is my first time posting a question and to that i apologize if this was the wrong process.

That being said, I could have easily asked Ian to elaborate if i was looking to rip anyone off for code itself but i didn't. And he is 100% correct that you <strong>CAN</strong> change the iframe content as long as it's on the same domain.

I apologize again if the process is incorrect and will close this thread up. But please don't offer advice and say it's not possible especially if something is possible and you're simply unaware on how to do it. It's unprofessional.

Andrea P comments:

I said I was 99% sure. so I feel that when you ask you should always assume that anyone here is just giving his best advice, based on his knowledge, and nobody is God that have to be taken as the only speaking truth.
I apologize if I wasn't aware of that and my assumptions were not precise, one more thing learned for me (and for you).

in any case, if my code was not the correct answer, then it probably was the discussion we've got, because even if there was a way to somehow achieve at least some of your requirements, it wasn't a good idea and it was requiring too much effort and there were surely better solutions (infact you've dropped it).

so in many ways, my advice did actually solve your question, if my code didn't.

but don't worry, I am not gonna die for your $20 dollars. and I wasn't arguing because I wanted the money. keep them and have a nice lunch at McDonalds, I'll cook something at home today. ;)

I whish you to find a solution for this new issue and for any other future question you'll post. I'll take care of not replying anymore, so you won't have to read my unprofessional advice.

Kind Regards

paviod comments:

Consider this thread closed....

And it's wish not whish for your own future reference. Have a great day.