Calling Title as Category in array
-
I have created a gallery and finally got it working. I am looking to add media images to each profile using the person title to call the category name.
I saw this and cannot find the right way to get it to work.
The gallery works using this:
‘<?php
echo ‘<div id=”links” class=”galleries links”>’;
$args = array(
‘post_type’ => ‘attachment’,
‘numberposts’ => -1,
‘order’ => ‘DESC’,
‘category_name’ => ‘galleries’,
‘post_status’ => null,
‘post_parent’ => null, // any parent
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $post) {
setup_postdata($post);
the_attachment_link($post->ID, false);
}
}
echo ‘</div>’;
?>’Im trying to get this to work in it:
$catname = array( ‘category_name’ = wp_title() );
Can anyone help me
- The topic ‘Calling Title as Category in array’ is closed to new replies.