Get_template_part inside filter?

You can use output buffering to get the template output and return it in place of the emptied shortcode content: if ($pos !== false) ob_start; get_template_part(‘content-gallery.php’); $contentgallery = ob_get_contents(); ob_end_clean(); return substr_replace( $content, $contentgallery, $pos, strlen($shortcode[0]) );` } EDIT It might make it easier to just replace the gallery shortcode? remove_shortcode(‘gallery’); add_shortcode(‘gallery’,’my_content_gallery’); function my_content_gallery() { … Read more

How to retrieve media images urls in different sizes?

I don’t understand your code in full (how your foreach’s actually fill your list item), but, as for the specific question, I think that the function you want is wp_get_attachment_image_src(); So (illustratively): $thumbnail_src = wp_get_attachment_image_src( $picture->ID ); $image->thumbnail_url = $thumbnail_src[0]; $full_src = wp_get_attachment_image_src( $picture->ID, ‘full’ ); $image->full_url = $full_src[0];

Gallery image caption inside link

You should get the attachment differently. Use wp_get_attachment_url for the file url https://codex.wordpress.org/Function_Reference/wp_get_attachment_url In your case it’s an image so I would suggest wp_get_attachment_image_src so you can define an image size. https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/ This way you can greate your own “template” to echo the image link. To get the image metadata you can simply use get_post( … Read more

Separate Content from gallery (custom post type)

You can do something like this <?php get_header(); ?> <section id=”content”> <div class=”container”> <?php get_template_part(‘inc/page-title’); ?> <div class=”row”> <?php if (have_posts()) : ?> <?php /* Start the Loop */ ?> <?php while (have_posts()) : the_post(); ?> <div class=”col-sm-7 post-thumb large-thumbnail”> <?php the_post_thumbnail(‘model-full’, array( ‘class’ => “img-responsive” )); ?> </div> <div class=”col-sm-5 entry-content profile”> <?php $properties … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)