How to remove parent section in an attachment URL in wordpress?

You can add a filter to the function that gets attachment links to force that format: function wpa60888_attachment_link( $link, $id ){ return home_url() . ‘/?attachment_id=’ . $id; } add_filter( ‘attachment_link’, ‘wpa60888_attachment_link’, 10, 2 ); Calls to get_attachment_link will have this filter applied to the output.

Get unique post in parent category

you can easily find solutions for this by using google. — edit with solution for duplicates — to filter out your duplicates fill an array with the ids. then check if the post is in the array if not print it , otherwise skip it. you said you have solution for getting the posts so … Read more

Or operators in PHP [closed]

try this <?php if ( (! is_page_template(‘modelPages.php’)) || (! is_archive()) || (! is_single) ) { ?> Think your ‘not’ ! is causing the issue. btw, you could move it to this <?php if ( !( is_page_template(‘modelPages.php’) || is_archive() || is_single() ) ) { ?>

Showing all post from all post type in admin backstage

You can use a $wpdb->get_results for this. I am not an mySQL expert so I will give you the pseudo code instead global $wpdb; $data = $wpdb->get_results( SELECT posts.ID ID, posts.post_title title, posts.post_author author, postmeta.isbn isbn FROM $wpdb->posts posts JOIN $wpdb->postmeta postmeta ON posts.ID = postmeta.post_id WHERE posts.post_type=”post_type_1″ OR ‘post_type_2’ OR ‘post_type_3’ GROUP BY posts.ID … Read more

WXR XML import is stripping php tags that I need to keep

Changing WordPress — installed all the right plugins? Just wondering are you migrating WordPress? … Did you have a plugin like Exec-PHP allowing PHP content in posts and pages on one install and that plugin is not active in another install of WordPress? WordPress by default doesn’t allow PHP in posts and pages so this … Read more

How to call the_author_meta and make it work?

Add your author meta information after if ( have_posts() ) : <?php if ( have_posts() ) : the_post(); ?> About <?php the_author(); ?>, the author of this blog <?php userphoto_the_author_thumbnail() ?> <?php echo get_the_author_meta( ‘description’ ); ?> <?php rewind_posts(); while ( have_posts() ) : the_post(); ?> <?php //loop stuff ?> <?php endwhile; else: ?> <p><?php … Read more

Category List in Theme Options Page

This may be an HTML issue. For a multiple select, the name of needs to end in “[]”, to signify an array. So try changing: <select name=”<?php echo $themename_option_name.'[‘.$valueid.’]’; ?>” id=”<?php echo $themename_option_name.'[‘.$valueid.’]’; ?>” multiple=”multiple” style=”height:150px; min-width: 200px;”> to <select name=”<?php echo $themename_option_name.'[‘.$valueid.’]’; ?>[]” id=”<?php echo $themename_option_name.'[‘.$valueid.’]’; ?>” multiple=”multiple” style=”height:150px; min-width: 200px;”> So you should … Read more