WordPress.org

Ready to get started?Download WordPress

Forums

WP Publication Archive
[resolved] Move download to same line as title (5 posts)

  1. trik_sea
    Member
    Posted 1 year ago #

    How do I move the word "download" adjacent the title of the file? I've removed the other information because I just need a simple list. I'd also like to remove the icon, if possible.

    So basically it looks like this

    File tile download

    Thanks.

    http://wordpress.org/extend/plugins/wp-publication-archive/

  2. Eric Mann
    Member
    Plugin Author

    Posted 1 year ago #

    I'm hesitant to recommend editing plugin files because your changes will be lost in an update. That's why there are filters provided everywhere, and that's why every element is loaded using a loop function (similar to how posts are loaded in the loop) so you can build your own shortcode rather than use the default one.

    My first recommendation is to build your own shortcode. Use the one that ships with the plugin as an example and just build it to output whatever markup you feel is appropriate.

    Take a look at the shortcode_handler() function in /lib/class.wp-publication-archive.php to see how I'm setting things up. It's fairly straight-forward ... each publication is just iterated through in a list and all of its properties are output to the screen.

    If you need to change the positioning of any element, I recommend doing so with custom CSS that you place separately in your theme.

  3. trik_sea
    Member
    Posted 1 year ago #

    Thank you for your prompt response. I've followed your suggestions and created a custom function file that I am now calling from. I'm very familiar with css but don't know how to use it to position a $list function. I'm not too familiar with php, so that is probably where I'm having trouble. I basically want to take the
    $list .= $pub->get_the_title(); and $list .= $pub->get_the_uri(); and put them next to each other. I really have no idea how to do this. Doesn't the very nature of the $list command create a new line?

  4. Eric Mann
    Member
    Plugin Author

    Posted 1 year ago #

    $list isn't a command, it's a variable. What we're doing by applying .= is concatenating the code together.

    So if get_the_title() returns <div>Title</div> and get_the_uri() returns <a href="">Uri</a>, then

    $list .= $pub->get_the_title();
    $list .= $pub->get_the_uri();

    will store <div>Title</div><a href="">Uri</a> in the variable $list. It's just a container, nothing more. You need to use CSS to tell the browser where to position the individual elements on the page. If you provide a link to your site, I can tell you exactly where to put it and what you need to write.

  5. trik_sea
    Member
    Posted 1 year ago #

    Thank you for the explanation. I've figured it out. In case anyone else is interested, I added display:inline; to publication_title and it brought up my download link. I now need to move this to my custom css instead of the plugin css, of course.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.