Andy Mercer
Forum Replies Created
-
Forum: Plugins
In reply to: [Featured Galleries] Example galleriesYeah, I can do that. I’ve been getting my website up and running over the past two weeks, and I’m building a demo area, so some examples of galleries will fit there perfectly.
Forum: Plugins
In reply to: [Featured Galleries] Featured Galleries implementationSince you haven’t responded I’m going to mark this as resolved. If you still have questions, add a comment here and change the status back to un-resolved.
Forum: Plugins
In reply to: [Featured Galleries] Featured Galleries implementationBasically there are two parts to creating something like this. There has to be code to create the interface in the admin section that lets a user add images to create the gallery and store the data in the WordPress database. The second is code in the theme itself that retrieves the data from the database and converts it into an actual image gallery on the webpage.
This plugin does step 1. Step 2 I’ve left to theme developers, because it means that they can be flexible. Data is stored as single text entry, with the image IDs separated by commas. You need to add code in the theme template file to retrieve this data, then split it into an array, and then loop through the array. Inside this array loop, you have to convert the image ID into the URL of the image, and create the HTML.
The example code that you listed in your question retrieves the data using a custom function which I’ve built in, that does the conversion from comma-delimited string to array for you. It gets the array, then it loops through using the
foreach
. It gets each image’s URL using the WordPress functionwp_get_attachment_url();
This code will end up giving you a list of images.If you place that on
single.php
, it’ll be the full gallery. You can tweak it to get just the first image of the gallery for the homepage. You can do this by using this codeget_post_gallery_ids($post->ID,1);
. The1
will tell it to just grab a single item. It’ll still be an array though, so still do thefor
loop.Given the large number of people wanting pre-built galleries, I’m considering writing a few examples and including them. If the plugin had something like that included, would it be helpful to you?
Forum: Plugins
In reply to: [Featured Galleries] How to Insert the Gallery Codes?I’m going to mark this as resolved because you have never responded. If you still need help, add a comment and mark it as not resolved.
Forum: Plugins
In reply to: [Featured Galleries] How to Insert the Gallery Codes?xycris, do you still need help with this?
Forum: Plugins
In reply to: [Featured Galleries] How to Insert the Gallery Codes?First, as stated in the plugin’s description, this plugin is specifically directed at theme developers, it’s meant to be incorporated into themes. It requires coding knowledge.
I can try to help but you’re going to need an understanding of PHP and how WordPress themes work, along with CSS and HTML if you want to built this into your theme. The only thing this plugin does is create the backend integration with WordPress. You have to build the front-end display gallery yourself. To try and help, I need some more information:
What theme are you using?
What pages do you want it on?
Do you know how to get anchor links from inside the loop?Forum: Plugins
In reply to: [Featured Galleries] No option to add gallery images in custom post typeGreat! If you like the plugin, feel free to rate it as well.
Forum: Plugins
In reply to: [Featured Galleries] No option to add gallery images in custom post typeThe code below will add featured galleries to as many post types as you wish. It also will verify before adding that they really are post types still. (In case you later remove said post type).
function add_featured_galleries_to_ctp( $post_types ) { $postTypeArray = array( 'ctp1', 'ctp2', 'ctp3' ); $verifiedPostTypeArray = array(); $i = 0; foreach ($postTypeArray as $postType) { if( post_type_exists( $postType ) ) { $verifiedPostTypeArray[i] = $postType; } $i++; } return $verifiedPostTypeArray; } add_action( 'fg_post_types', 'add_featured_galleries_to_ctp' );
You’d add it to your functions.php file. However, it’s long because of the verification. I will be adding verification on the inside of the hook in the next update to this plugin, so pretty soon you’ll be able to not use the verification. At that point, the code you add to your functions.php file will be:
function add_featured_galleries_to_ctp( $post_types ) { return array( 'ctp1', 'ctp2', 'ctp3' ); } add_action( 'fg_post_types', 'add_featured_galleries_to_ctp' );
Forum: Plugins
In reply to: [Featured Galleries] How to make the gallery show up on postI’m marking this resolved since you haven’t responded.
Forum: Plugins
In reply to: [Featured Galleries] How to make the gallery show up on postCould you post the PHP code that you’ve written to build the front end gallery? Are you using jQuery or vanilla JS?
Forum: Plugins
In reply to: [Featured Galleries] How to get images in Front-endOkay, so I’ve read through this. You just need to replace the code you mention with the code I have written in the tutorial on the main page of the plugin readme.
Forum: Plugins
In reply to: [Featured Galleries] How to get images in Front-endJust saw this post, import. When you ask a question, you should start a new thread instead of just posting in an already Resolved thread. I didn’t see this until now because of that.
As to your question, I’ll have some time tomorrow morning to take a look, I should be able to get you an answer then.
Forum: Plugins
In reply to: [Admin Classic Borders] Elements of responsive Admin BarSnih, have you resolved this? It’s been a week since I responded and I haven’t heard anything back from you.
Forum: Plugins
In reply to: [Admin Classic Borders] Elements of responsive Admin BarThe menu bar icons are supposed to increase in size, with many being hidden. This is what it looks like on my Android phone.
Forum: Plugins
In reply to: [Featured Galleries] Multiple galleries?The best way might be to just add some custom CSS to hide the editor and the TinyMCE row of buttons, in that case.