WordPress.org

Ready to get started?Download WordPress

Forums

Need Help Placing A Code Please! (27 posts)

  1. youngr
    Member
    Posted 2 years ago #

    Hi, I'm trying to use the plugin featured content gallery but do not know where to add the code to display the gallery above all posts?

    Any ideas? thanks!

  2. Sorry about that, deleted all the spam.

    Can you link to the plugin? The one named content-gallery (http://wordpress.org/extend/plugins/content-gallery/ ) doesn't exist.

  3. Lindy Norris
    Member
    Posted 2 years ago #

    I believe they are referring to the plug-in: http://wordpress.org/extend/plugins/featured-content-gallery/ The installation instructions can be found at: http://www.featuredcontentgallery.com/install-setup/

    If you are wanting to add the gallery above all posts then you'd probably want to do this in single.php. Depending on your layout you might possibly do this in header.php.

  4. Altaf Hussain Patel
    Member
    Posted 2 years ago #

    @lindy norris ... he says that he want to add above posts to you have to add the code to the single.php

    kindly share the code of single.php so me can try my best to help...

  5. youngr
    Member
    Posted 2 years ago #

    Hi guys, thanks for all the advice. I can confirm that it is called Featured Content Gallery: http://wordpress.org/extend/plugins/featured-content-gallery/

    The problem is the setup does not specifically tell me where I can place it. I would love to have it above all new posts on the front page e.g. very similar to a sticky?

    My single.php:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  6. Nihad Nagi
    Member
    Posted 2 years ago #

    For adding the Gallery itself:
    Place this code in your theme files, where you want it to appear. In your case, add the following code at your home-page template.php

    <?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>

    For placing content inside the gallery:
    If you’re just using the default settings, you just need to use the articleimg custom field. Simply add this custom field to each post or page you’re featuring, and add the full URL to the image you’d like to display in the value. If adding custom thumbnails, custom text, or alt tags you need to add the thumbnailimg , featuredtext or alttext custom fields.

    If you need more help regarding custom fields, feel free

  7. esmi
    Forum Moderator
    Posted 2 years ago #

    No - don't use ABSPATH. That is a reserved internal variable. Use plugin_dir_path().

  8. youngr
    Member
    Posted 2 years ago #

    @nihad I tried adding the code but nothing shows up? Any advice?

  9. Nihad Nagi
    Member
    Posted 2 years ago #

    You mean the whole gallery or featured content that doesn't show up?

  10. Nihad Nagi
    Member
    Posted 2 years ago #

    If the gallery is not showing then:
    Then it was pasted in the wrong place. Do the following as a quick test.
    Place the PHP code for the gallery inside template "header.php", you can leave it there, if you want the gallery to be available, the same way as your logo for all content. Just test it. If you need it, in any other place, tell me how and I will tell you where.

    If the Featured items are not showing:
    Then custom fields are not set properly, advice,and will guide you through.

  11. youngr
    Member
    Posted 2 years ago #

    I've just placed the code into the header.php and nothing is coming up for some reason?

  12. Nihad Nagi
    Member
    Posted 2 years ago #

    Switch to another template, and try doing the same thing. JS conflicts is a possible reason.
    Let me know.

  13. Nihad Nagi
    Member
    Posted 2 years ago #

    Additionally, before further troubleshooting, watch this instructional video, and make sure you complied with all the steps.

    Featured Content Gallery - Instructional Video - iePlexus

    Let me know, how it went.

    Regards.

  14. youngr
    Member
    Posted 2 years ago #

    Sorry, I know I'm probably going to be a nuisance but switching templates will ruin my blogs look. Is there no other way?

    Or maybe I could get a different plugin?

  15. Nihad Nagi
    Member
    Posted 2 years ago #

    Don't say that, no you are not.

    Switching is done very easily, without affecting or ruining anything.
    Go to Appearance, Activate another theme, go test your plugin, and if it works then we know it's a theme related issue, and when you are done, activate your theme again, and nothing is gone or changed.
    That's why theme files are stored and edited separately, so you can change the look of your website every day, with all of your things the same they are.It's just a press of a button.

    By the way, I really like helping younger :)

  16. esmi
    Forum Moderator
    Posted 2 years ago #

    Is there no other way?

    No. Troubleshooting is a process of elimination. Some times you will be asked to switch themes as part of that process. With luck, the change will only be temporary but, in some cases, it proves that the problems are within the theme (in which case, you may have to consider using another theme).

    Bottom line: do you want a working site? If the answer is "yes", then please help us to help you by following the suggestions you have been given.

  17. youngr
    Member
    Posted 2 years ago #

    You guys made me smile :) - Thank you

    Ok, as instructed I quickly tried using the code in the header php for a the twenty ten theme and it still would not show up.

    I'm starting to think maybe another plugin is affecting it?

    I've switched back to my current theme.

    So what's next ? :P

  18. Nihad Nagi
    Member
    Posted 2 years ago #

    This is a normal thing, when using these libraries, because of JS conflicts.

    Could you send me a link to your website?
    or
    paste the "header.php" in the pastebin, if you don't know pastebin, paste it here and you will know.

  19. youngr
    Member
    Posted 2 years ago #

    Thanks for your consistency. The URL is http://www.harddope.com

    Will you be able to diagnose where the issue lies?

    Thank you

  20. Nihad Nagi
    Member
    Posted 2 years ago #

    I am in the process of analyzing your page.Even-though, am sober for three years now :). Please check my music portal, I made for many reasons, but I have no time adding music ,please check it out, and we can together, make fortune out of it,check it out:

    I will get back to you, as soon as I am out of dope.

  21. Nihad Nagi
    Member
    Posted 2 years ago #

    Well after analyzing your dope, I noted the following:

    You are using w3total cache plugin, and JS minification is active, normally, caching is activated once your website is fully completed. w3total, because of the activated feature, minified all js into one single file and ignores any other js calls by other plugins, that's the reason, even switching themes didn't work, w3total now redirect all js calls to a single minfied js library, so all calls needed by any other plugins, most of them are ones installed after the activation of these settings, are redirected to the minified js which doesn't find the needed script, so it will never work on whatsoever theme you select.
    Additionally, the minified JS file in wp-content/w3tc/min/804750a4.5ddcaa.js.
    Note, the /min/ referring to MINified and the file 804.......js is your minified javascript file, this file got an error in it, an uncaught reference error:gallery in not defined.
    Consequently, the first thing you would do, is to disable all caching techniques by w3total, and once your are done with your website, enable it again. After you do, consider implementing the steps mentioned above.

    After disabling caching and retrying what was mentioned above, we can start diagnosing properly.

    Regards.

  22. youngr
    Member
    Posted 2 years ago #

    Haha, Glad you've been sober for 3 years :)

    Also I can't see your link for the music portal? Try posting it again ?

    How did you check all those details of mine?

    I followed your instructions and I did see the gallery! but after I reactivate my total cache it just disappears again. I'm stuck again? lol

  23. Nihad Nagi
    Member
    Posted 2 years ago #

    Oh finally!!!!! Thanks the Lord.

    We had to deactivate the plugin, to trace the root cause. You can activate it again,but disable JS minification.Don't forget to press "Empty the Cache" and make sure that caching is not active for logged in users.Whenever, you make a change to the caching settings, you have to empty the cache, my advice to you, is to disable caching until all your website is finished.
    My music website
    Questions starting with "How", are never answered by magicians. :)

  24. youngr
    Member
    Posted 2 years ago #

    Not Bad! Have you got a twitter? or email?

    The problem is now solved but I am using a different plugin! FA Lite

    JS Minification has to be disabled in order for the plugin to work as you stated.

    Magicians :P lool

  25. Nihad Nagi
    Member
    Posted 2 years ago #

    Who doesn't?
    I haven't completed it yet.
    Am glad it finally worked out.
    my email is [email address removed]

  26. Nihad Nagi
    Member
    Posted 2 years ago #

    nihadnagi at hotmail, emails are removed here

  27. Nihad Nagi
    Member
    Posted 2 years ago #

    It's been a while, but OK.

    See you on the next Gallery.

Topic Closed

This topic has been closed to new replies.

About this Topic