WordPress.org

Support

Support » Plugins and Hacks » WP Publication Archive » [Resolved] Move download to same line as title

[Resolved] Move download to same line as title

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Eric Mann

    @ericmann

    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.

    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?

    Plugin Author Eric Mann

    @ericmann

    $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.

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Move download to same line as title’ is closed to new replies.
Skip to toolbar