• Hi,

    I have a website built with WP (https://mavromatika.com/en/home/ ).
    I work in data-visualization, so I need to show my work without my website’s template, basically as single-page mini-websites (one per visualization).
    Currently I host each single-pager elsewhere (like here : https://bl.ocks.org/Mavromatika/raw/00b6d4ac5002e0a8dd33c76f0ca776f9/ ).
    But I would like to have everything on my own domain.

    I don’t mind uploading each visualization’s files manually to the server (since I can’t upload html nor javascript as regular media in WP). But I’d like to have a nice permalink for each.

    How would you go about this ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Well you *could* create a template file to display each (maybe single-vis.php), and have a different header called instead of the normal header.php file, and in that custom header (“header-vis.php” maybe?) have a different stylesheet that is a stripped down version, only styles you need. And maybe leave out the <header> part that calls your menu, logo, etc.

    Do the same thing with the footer if you need to remove your current Theme’s normal footer stuff…..

    BUT you’d want to be sure to include somewhere a link back to your (normal) site maybe?

    Then in your site, you can have a thumbnail image that links to the content that uses single-vis.php instead of the normal single.php.

    You could do that either by having your data visualizations as a Custom Post Type OR in a unique category, if you go the latter route just replace your single.php with something like:

    if ( have_posts() ) { the_post(); rewind_posts(); }
     if ( in_category('36') ) { // whatever is the 'real' category
     include(TEMPLATEPATH . '/single-vis.php');
     } else {
     include(TEMPLATEPATH . '/single-normal.php');
     }

    Copy your single.php to single-normal.php first of course! ??

    Then WP will use your new Template file (single-vis.php) which calls your new header file (header-vis.php) and if needed a new footer file (footer-vis.php) as it builds each page dynamically.

    Good luck!

    Thread Starter mavromatika

    (@mavromatika)

    Hi TrishaM, thank you for your reply.
    Each visualization I have is made of at least 1 HTML, 1 Javascript and 1 data (csv, json…) file. I sometimes have separate CSS too.
    So basically each “single-vis” should serve the HTML file with all the associated js, css, json etc.
    How would you go about doing this with what you propose ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding single-page websites to WP’ is closed to new replies.