Problem by $output and permalinks

The template tags the_permalink and the_title do not return values, they echo them. Use get_permalink and get_the_title instead. As an aside, the earlier are simply wrappers that echo the return of the latter. As another aside, yes, the naming is inconsistent. (And yes, that’s annoying. At least to me.)

How do i get post thumbnail using attachment code

I can’t tell if you want a link to the thumbnail or you want the image to be the thumbnail. To get the image assigned to the post as the thumbnail image, use get_the_post_thumbnail: $thumb = get_the_post_thumbnail($post_id, ‘thumbnail’); To get the thumbnail using the attachment ID use wp_get_attachment_image: $thumb = wp_get_attachment_image( $attachment_id, ‘thumbnail’ ) Not … Read more

How to remove permalinks links presents in each page of my site?

You can do this in 2 ways: Remove it from HTML source code (harder, but more correct) Find <footer class=”post-meta”> in your theme files, and remove (or comment) it (with contents). You will see something like this in one of your files: <footer class=”post-meta”> … <a href=”https://wordpress.stackexchange.com/questions/105324/…</a> … </footer> Just remove this part of code … Read more

add_query_arg() for custom post type on all visible links

Filter post_type_link instead. This is reserved for custom post types, and you get the post object, so you don’t need a global variable for this. is_admin() or add_filter( ‘post_type_link’, ‘career_position_url’, 10, 2 ); function career_position_url( $url, $post ) { global $career_mb; if ( ‘career’ !== $post->post_type ) return $url; $career = $career_mb->the_meta(); return add_query_arg( ‘position’, … Read more

Post titles and thumbnails as links to custom post types?

Something like this should solve your problem… <?php $pfportfolio = new WP_Query( array(‘post_type’=>’portfolio’, ‘posts_per_page’=>-1) ); ?> <?php if ( $pfportfolio->have_posts() ): ?> <ul class=”thumbnails”> <?php while ( $pfportfolio->have_posts() ) : $pfportfolio->the_post(); ?> <li class=”span4″ data-id=”post-<?php echo esc_attr(get_the_ID()); ?>” data-type=”<?php echo esc_attr(strip_tags( get_the_term_list( $post->ID, ‘location’, ”, ‘ ‘, ” ) ) ); ?>”> <a href=”https://wordpress.stackexchange.com/questions/108357/<?php the_permalink(); … Read more