logo
We have finished migration to the new data center successfully and are working out some minor issues within the site's code. If you experience any difficulties or have any questions please email us at [email protected].
Ask your WordPress questions! Pay money and get answers fast! (more info)

This member is one of the top experts of all time, the true elite. Ivaylo Draganov

Website

Answers Given: 122 (see them all)
Contests Won: 82
Prize Money Earned: $866
Questions asked: 0
Questions refunded: 0 (see all?)
Is a top asker (has the power to vote on anything):
Subscribes to all the discourse posted to the site?: No
Country: Bulgaria
City:
Netvotes this month (upvotes minus downvotes): 0
Netvotes of all time (upvotes minus downvotes): 4
Joined the site: September 11, 2010





Ivaylo Draganov's upvoted answers:






This member has no downvoted answers






Answers given to these questions:

See more?






Questions voted:

The community is grateful to those experts who take the time to vote on questions.

See more?






Ivaylo Draganov has not asked any questions






This member has not made any recommendations. If you are one of the top experts, please offer one now!






Ivaylo Draganov's discourse:

Written in response to Redirect exit page: Get external url from custom field:

It seems to work now, but I had to change esc_url to esc_url_raw. Is it ok to use esc_url_raw instead?


Yes, it's fine to use esc_url_raw in this case.

Another thing, this one needs javascript to work right? Is there another way to make the redirect not javascript dependent?


Yes, it can be made with a <meta> tag. Remove the JS redirection code and add this to functions.php:


<?php
function custom_add_redirect_meta_tag() {

$exit_post_id = get_query_var( 'exit' ) ? get_query_var( 'exit' ) : 0;
$redirect_url = $exit_post_id ? get_post_meta( $exit_post_id, 'external_url_custom_field', true ) : '';
$timeout = '5'

if ( $redirect_url ) {
echo '<meta http-equiv="Refresh" content="' . $timeout . ';url=' . $redirect_url . '">';
}
}

add_action('wp_head', 'custom_add_redirect_meta_tag');
?>

link

Written in response to something Brennen Jones wrote.

Hi,

you can get pagination for image attachments, but it involves some code fiddling. It might be just easier to try this in you attachment.php:


<?php if ( wp_attachment_is_image( get_the_ID() ) ) echo do_shortcode( sprintf( '[gallery id="%1$s" exclude="%2$s" columns="8"]', $post->post_parent, get_the_ID() ) ); ?>


This loads a gallery of all the images attached to the same post, but excluding the current image. I think it's far better than having numbered links.

link

Written in response to Galleria Twelve theme enqueued properly but NAV not displayed:

How did you figure it out - what tool would you recommend and link to how to use it?

I used Firebug for Firefox to inspect the nav elements and track down the CSS rules applied to them. I then tried opening the images, but there was an error with them.

You can use Chrome/Safari's developer tools or Opera's Dragonfly to inspect web-pages, if you're not working with Firefox.

link

Written in response to Why Attachment Page Defaults to Article Page?:

I really like this SEO plugin but now may have to find another alternative. I liked this one better than the All-in-One SEO pack.


I'd recommend sticking with WordPress SEO. It is quite comprehensive and the author is proficient in both SEO and WP. The plugin is actively developed and new options appear often. You might have overlooked that particular one regarding attachment pages.

link

Brennen Jones had responses to this.

Written in response to Shortlinks for Custom Post Types:

Why not use a filter to apply the patch instead of hacking the core file? The function wp_get_shortlink has a filter at the very top allowing for plugins to entirely overtake the functions output. So, try putting this in your functions.php:

// Filter the default wp_get_shortlink
add_filter( 'pre_get_shortlink', 'filter_wp_get_shortlink', 10, 4 );

function filter_wp_get_shortlink( $shortlink = true, $id = 0, $context = 'post', $allow_slugs = true ) {

global $wp_query;
$post_id = 0;
if ( 'query' == $context && is_single() ) {
$post_id = $wp_query->get_queried_object_id();
} elseif ( 'post' == $context ) {
$post = get_post($id);
$post_id = $post->ID;
}

$shortlink = '';

// Return p= link for posts.
if ( !empty($post_id) && '' != get_option('permalink_structure') ) {
$post = get_post($post_id);
if ( isset($post->post_type) && 'post' == $post->post_type )
$shortlink = home_url('?p=' . $post->ID);
}
// Return p= link for all public post types.
if ( !empty($post_id) ) {
if (!isset($post)) {
$post = get_post($post_id);
}
$post_type = get_post_type_object( $post->post_type );
if ( $post_type->public ) {
$shortlink = home_url('?p=' . $post_id);
}
}

return apply_filters('get_shortlink', $shortlink, $id, $context, $allow_slugs);

}

link

Written in response to Move Publish MetaBox to Bottom:

This has to be placed before get_currentuserinfo(); or it won't work because that information is not available until pluggable.php is called.


It worked for me without calling that file. I'd recommend wrapping the code inside a function and calling it at the appropriate moment via an action hook. Something like:

function change_default_screen_layout () {

// paste all the code here

}

add_action( 'init', 'change_default_screen_layout' );

link

Written in response to Comment Author VCard (This is the easiest $4 you will ever make):

That's not quite a good approach because if somebody uses the &lt;em&gt; tag in their comment it would get styles too. You could get away with using a descendant selector:

comment-body > em { /* styles */ }


But the most flexible way is to use a custom callback function:
http://digwp.com/2010/02/custom-comments-html-output/

link

See more?






Ivaylo Draganov has not had any questions refunded






Ivaylo Draganov suggested these prizes as appropriate for these questions:

See more?