• Hi there,

    I’m really keen to implement a Wikipedia Citation Generator on my website : see for example
    https://www.powerhousemuseum.com/collection/database/?irn=207936 (if
    you scroll down to the bottom)

    I am struggling to find instructions on how to do this online. I think
    it should be pretty easy but I am not sure where to start.

    this is the html from the powerhouse museum example

    </div>Copy and paste this wiki-markup: <br /><br /><div
    style="background-color:#ddddcc; border: solid 1px #333333; padding:
    5px; margin-bottom: 1px; font-family: Courier, monospace;
    text-align:left;font-size:11px">{{cite web |url=https://from.ph/207936
    |title=Australian Six motor car |author=Powerhouse Museum
    |accessdate=2 February 2012 |publisher=Powerhouse Museum,
    Australia}}</div>

    It seems like i just need a way of automatically calling in the post-title, the URL, and
    the date.

    I am not sure whether I can do this from the post html or whether i need to go into the php files.

    it would ideally appear at the end of every post.

    I have played around in the post html with title=<?php get_the_title(); ?> but it doesn’t work.

    Any ideas or pointers in the right direction would be much appreciated

    thanks!

    adam

Viewing 7 replies - 1 through 7 (of 7 total)
  • You cannot use that wiki markup in your WordPress Pages or Posts.

    Thread Starter adam37

    (@adam37)

    hi esmi. i realise that. the idea is to create a template so that others can easily cite the posts in wikipedia. if you look at the example you will see what i mean.

    I understand that. But you cannot use wiki mark-up in a non-wiki page. and that’s wiki markup.

    Thread Starter adam37

    (@adam37)

    sorry i was perhaps not clear enough in my initial post. i am not trying to use the wiki markup at all. simply display what a wikipedia user would have to copy and paste into the wikipedia editing backend in order to successfully ‘enact’ the markup and so cite the post.

    i simply don’t know how to automatically call in the current post title/url into the html, and also was wondering about whether it was best done through php.

    simply display what a wikipedia user would have to copy and paste into the wikipedia editing backend

    Ah!!! Try just adding:

    {{cite web |url=https://from.ph/207936
    |title=Australian Six motor car |author=Powerhouse Museum
    |accessdate=2 February 2012 |publisher=Powerhouse Museum,
    Australia}}

    to your Posts and/or Pages. If you want it to appear automatically in every Post and/or Page, you may need to roll your sleeves up and start some theme template editing.

    Thread Starter adam37

    (@adam37)

    If you want it to appear automatically in every Post and/or Page, you may need to roll your sleeves up and start some theme template editing.

    well this is exactly what i want help with! i am rolling up my sleeves and struggling and so have come on here to ask for help.

    my question is about using the “Function Reference/get the title” (and also the post url equivalent) to make it automatic.

    Assuming you’re referencing the current page’s title and url, something like:

    {{cite web |url=<?php the_permalink();?>|title=<?php the_title();?>|author=<?php the_author();?>;?>
    |accessdate=<?php the_time( 'j F y' ); ?>|publisher=<?php bloginfo( 'name' );?>}}

    should do it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘get_post_title/url in html of post’ is closed to new replies.