WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Short Code issue please help (38 posts)

  1. y0mannn
    Member
    Posted 2 years ago #

    I have a shortcode from a plugin.
    It is [slider3d_gallery 2000 /]
    I want to add this on my homepage at a specific location.
    I can't edit my homepage content.
    So i'll have to add it as HTML.
    The place I want to add it as would replace this:
    <img title="x" src="http://xxxxxx/wp-content/uploads/2000/12/xxx.jpg" alt="">
    But the problem is: How do I convert that shortcode to HTML
    so I can replace it with that Img

    I'm using latest version, 3.3

    Thanks so much, Merry Christmas

  2. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

  3. y0mannn
    Member
    Posted 2 years ago #

    ^^ Now I have, and they all are by you =)
    Anyways, do you have a solution for this?

  4. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    We have no idea what you are asking.

  5. y0mannn
    Member
    Posted 2 years ago #

    We?
    well okay, here you go. I have a short code (that can be placed in posts/pages etc) I want to place that in my php as HTML instead. It's as simple - how do I convert the short code to HTML so I can place it in php.

  6. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    Surely we have also found such so 'simple'

  7. y0mannn
    Member
    Posted 2 years ago #

    How can you not understand this?
    This is a similar topic
    http://wordpress.org/support/topic/why-dont-shortcodes-work-in-sidebar-widgets?replies=3%29

    Except this person is trying to put it in a widget, where i'm trying to put it on my homepage

  8. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    quick you are

  9. y0mannn
    Member
    Posted 2 years ago #

    Okay, honestly. If your not helping or not volunteering, or don't know the solution to the problem, please don't reply. Your really getting annoying now.

  10. vjpo
    Member
    Posted 2 years ago #

    You can place
    <?php echo do_shortcode('[slider3d_gallery 2000 /]'); ?>
    http://codex.wordpress.org/Function_Reference/do_shortcode

    If you really want a static html, place this shortcode in post, then copy/paste the part of an html code that produced by shortcode from a page source.

  11. y0mannn
    Member
    Posted 2 years ago #

    When I put it on a page/post, it works like a charm.
    When I put
    <?php echo do_shortcode('[slider3d_gallery 2000 /]'); ?>
    in .php, nothing appears. No errors either.

  12. vjpo
    Member
    Posted 2 years ago #

    Try plan b (copy/paste) :)
    Unfortunately, I can't test this plugin now. But do_shortcode() must work. Check if the code is correct.

  13. y0mannn
    Member
    Posted 2 years ago #

    I don't know why it isn't working and I'm not very good with the source code thing (there is just too much). Not sure, could you check into this for me?

  14. y0mannn
    Member
    Posted 2 years ago #

    Okay, I tried this again.
    I added this on front-page.php at the location I wantd it to be.
    This is what I added:
    <?php echo do_shortcode('[slider3d_gallery 2000 /]'); ?>

    Now instead of having the actual plugin display there, it displays this as a text: [slider3d_gallery 2000 /]

    I have checked the code many times now and it is definitely right, I have tried the same code in pages and it works.

    What is wrong then?

  15. Now instead of having the actual plugin display there, it displays this as a text: [slider3d_gallery 2000 /]

    That means it can't pull the code in.

    Where are you getting slider3d_gallery? Is it from a plugin? Which one?

    Not all shortcodes work outside posts.

  16. y0mannn
    Member
    Posted 2 years ago #

    ehh smart guess.
    Yes, I'm using slider3d_gallery.
    I don't mind using something similar that would work.
    I just like the animations of slider3d and it's exactly how I want.

  17. y0mannn
    Member
    Posted 2 years ago #

    Oh. Misread what you wrote.
    Yes, it's a plugin. The plugin name is slider3d_gallery
    and I'm getting the "slider3d_gallery" message exactly where I want my plugin to display. It's on the homepage.

  18. This one: http://wordpress.org/extend/plugins/slider3d-gallery/

    Okay. What about this:

    <?php echo do_shortcode('[slider3d_gallery 2000]'); ?>
  19. y0mannn
    Member
    Posted 2 years ago #

    Okay, I tried this again.
    I added this on front-page.php at the location I wantd it to be.
    This is what I added:
    <?php echo do_shortcode('[slider3d_gallery 2000 /]'); ?>

  20. y0mannn
    Member
    Posted 2 years ago #

    After trying that, the text appears.

  21. vjpo
    Member
    Posted 2 years ago #

    I just tested it also. Doesn't work out of post/page content ($content).

    function slider3d_gallery($content){
    	$content = preg_replace_callback("/\[slider3d_gallery ([^]]*)\/\]/i", "slider3d_gallery_render", $content);
    	return $content;
    }
  22. Yes, notice how I dropped the / from the code ;) There was a reason.

    So when 'the text appears' youmean 'All I get on the page is [slider3d_gallery 2000]

    Is this page a WordPress page?

    And if so, can you post the code for it to pastebin.com and link it here?

  23. vjpo
    Member
    Posted 2 years ago #

    Can't get it as an external shortcode, but it's possible. You may ask author of plugin to provide this feature.

  24. y0mannn
    Member
    Posted 2 years ago #

    @Ipstenu Same thing without the "/"
    Yes, that's what I mean
    Yes, it's a wordpress homepage
    What kind of code do you need? I'm sorry, kinda lost

    @Vjpo, I have tried. Author won't reply and I can't find any other similar plugin that would do the work.

  25. y0mannn
    Member
    Posted 2 years ago #

    @vjpo Are you aware of any other plugin, or code, or something that would do the work - if it won't work out of post/page content ($content).

  26. vjpo
    Member
    Posted 2 years ago #

    The problem - this is not a short code. I didn't get a stable running of copied/edited slider3d_gallery function in header.php. One time it works, one not.
    May be some code ninjas will kill this question )
    You can find other plugins in google search or in the plugins section of this site by using keywords like flash featured slider plugins wordpress

  27. y0mannn
    Member
    Posted 2 years ago #

    I found top 15 here.

    http://www.tooft.com/15-wordpress-slide-show-plugins-featured-articles-home-page/

    Any suggestions which would work, rather than I try all of em?

  28. vjpo
    Member
    Posted 2 years ago #

    I am not an expert in flash sliders :) I am using little jQuery Cycle script for slideshows.
    But, according to saying "If the mountain will not come to Muhammad..." , there is custom trick for slider3d_gallery. A bit bulky, but slider will work in any other part of a theme.
    So, you can create new page, paste [slider3d_gallery 2000 /] , publish. Then insert, where you need in template, this code. Edit 2012 - the page id :)

    <?php
    $the_query = new WP_Query( 'page_id=2012' );
    while ( $the_query->have_posts() ) : $the_query->the_post();
        the_content();
    endwhile;
    wp_reset_query();
    ?>

    Of course if you have in theme automatic wp_page_menu(), this page must be excluded from menu.

  29. y0mannn
    Member
    Posted 2 years ago #

    Thank you genius, works like a charm.
    Just 2 things.

    1. I need to readjust it a little, I tried &nbsp because I had to move it to right a little. but they don't make any different.What should I do if I need to move it a little down, and little to the right.

    2. It sort of loads slow, which is not a problem but gets annoying. Any suggestions or do you know a plugin that would create a flash page, saying "loading" and use jquery to load up the page, so people see the loading page first and they see the homepage once everything is loaded.
    (saw this plugin on vbulletin)

    Thanks

  30. y0mannn
    Member
    Posted 2 years ago #

    worked fine for bringing it down
    I have tried the following for pushing it to the right that didnt work:
    1. &nbsp
    2. <dd>
    3. Blockquote

Topic Closed

This topic has been closed to new replies.

About this Topic