How to call a page in a widget ? (5 posts)

  1. Nessdufrat
    Posted 3 years ago #

    I'd like to insert the content of my about page in a widget (actually, I don't care about the widget, I only need it in a div). How can I code that ? I know I can do it by calling the database and getting the content of this particular page and then echoing it where I want it, but if there's a more elegant solution, I'll gladly take it :)
    I tried looking around, but using the key words "about page insert widget wordpress" in whatever order, you can guess that I get about 100 000 results, mainly some about inserting widgets in a page.
    I found a plugin which is doing it, but if possible, I'd rather hard-code it into my template, since I don't like widgets that much and I prefer to use them for things I can't insert myself in the code.

  2. Michael
    Forum Moderator
    Posted 3 years ago #

    a plugin?


    (have not used it myself; and there might be others...)

  3. Nessdufrat
    Posted 3 years ago #

    Yeah, I found it a while after posting my question. I'd prefer a wordpress function, but I guess I can try to take appart the plugin and pick up only what I need :) It's designed to be permanent, so I don't need the functionalities of a widget.
    Actually, one of the reasons I don't like widgets is because they show up as "primary" "secondary", etc. as ids, and it makes it difficult to have something clear ^^

  4. Michael
    Forum Moderator
    Posted 3 years ago #

    the basic WorPress function for getting a page is:

    get_page() http://codex.wordpress.org/Function_Reference/get_page

  5. Nessdufrat
    Posted 3 years ago #

    Oh, thanks, that's exactly what I was looking for :)

Topic Closed

This topic has been closed to new replies.

About this Topic