Wordpress custom PHP Shortcode to return Image IDs
$30-250 USD
Terminado
Publicado hace casi 7 años
$30-250 USD
Pagado a la entrega
Hello - I am trying to write a custom Wordpress shortcode that outputs the IDs of the images attached to a WooCommerce product. I started with an example script that I found online. But, this script outputs the image IDs in the Wordpress [gallery ids="id1,id2,id3"] shortcode
My goal is to have the shortcode return only the ID's separated by commas like
1045,1052,1056 and not use the do_shortcode('[gallery ids= function
Example page where the current function is outputting the shortcode is below. The gallery output is in the right column below the PDF icons.
[login to view URL]
The PHP code I am using is below. I don't know PHP at all...so please excuse if there are errors or I am doing this the wrong way.
Thanks!
<?php
add_shortcode('repeating-images-gallery', 'repeating_images_gallery_func');
function repeating_images_gallery_func($atts, $content) {
global $post, $wpdb;
$images = get_post_meta($post->ID, 'value',false);
$ids = array();
foreach ($images as $image) {
$attachment_id = $wpdb->get_var($wpdb->prepare(
"SELECT ID FROM $wpdb->posts WHERE guid = %s",
$image
));
$ids[] = $attachment_id;
}
$outids = do_shortcode('[gallery ids="'.implode(",", $ids).'"]');
echo "shake it up";
return $outids;
}
This is could be done within less than 1 hours. I just need to get rid few line and some text to get ID's only as return value
Relevant Skills and Experience
WordPress and PHP
Proposed Milestones
$35 USD - Code tweak
$35 USD en 1 día
5,0 (104 comentarios)
6,6
6,6
15 freelancers están ofertando un promedio de $90 USD por este trabajo
Hello!
With 98% to 99% completion rate, 1000+ successfully completed projects, and a 4.99 reputation (maximum possible, 5.0) (can be verified on my profile page https://www.freelancer.com/u/rajeshsonisl.html !!)... you can never go wrong choosing me :)
I am available to get started on your project right away. I look forward to your reply.
Thanks.
Kind Regards,
Rajesh Soni
i am ready to fix the issue and send me the login detail i will show you my past work too.
Relevant Skills and Experience
wordpress php html css
Proposed Milestones
$55 USD - default
Hello sir,
I would like to fix your script or i can check for other solution so let me if you are here with ftp info
Thanks
poonam
Relevant Skills and Experience
wordpress
Proposed Milestones
$83 USD - s
I have read your job description now,
it is very simple for me, I will give you correct result in a short time .
Please contact me. I am ready to start work right away.
Thansk for your review.
Hello, I'm Wordpress and PHP expert. I will need ftp access to test the script on your site. Will complete the work within 1 day.
Relevant Skills and Experience
PHP, Wordpress
Proposed Milestones
$45 USD - all work
Hi mate, I’d be glad to assist for plugin development .
I have read description carefully understand requirement and planned to proceed with your requirement.
Relevant Skills and Experience
I have 5+ years experience with web development. Proven experience in MySQL, HTML5, CSS3, JavaScript, Ajax
& Strong JQuery. Excellent command over MVC framework.
Proposed Milestones
$100 USD - Milestone
Hi there, I read your brief, looked at the code in the brief and the page referenced, the do_shortcode() function will process the shortcode, but you just want to display numbers on the page ?
Relevant Skills and Experience
I am a senior WordPress and PHP developer, working with both front and backend development.
Proposed Milestones
$100 USD - Completion
Can you please PM so I can get more clarification about your end goal, thanks.
Hello, I've gone through your requirements. I've prior experience with all the skills needed for the website.
Relevant Skills and Experience
I have Experience of more than 6 years in PHP, MYSQL, js, JQUERY, PHP Frameworks, AJAX , HTML5, CSS2/3, Bootstrap.
Proposed Milestones
$100 USD - Project
Can we discuss in detail and then finalize time and budget?
HI,
I would be glad to associate with you. Let's get it done with in your time limits & budget with high quality.
Please provide more feature details & Hire me for this project.
Relevant Skills and Experience
PHP, WordPress
Proposed Milestones
$277 USD - final delivery