<?php
$id=44; // ID заданной рубрики
$n=10; // количество выводимых записей;
$i = 1;
$recent = new WP_Query("cat=$id&showposts=1");
while($recent->have_posts()) : $recent->the_post();
if($i == 1) :
?>
//другой стиль
<?php else : ?>
<div class="uk-grid" style="margin-top: 5px;">
<div class="uk-width-1-10" style="width: 50px;"><a href="<?php the_permalink();?>" title="<?php the_title(); ?>"><?php echo get_the_post_thumbnail( $post->ID, array(30,30) ); ?></a></div>
<div class="uk-width-9-10 uk-text-large"><a href="<?php the_permalink();?>" title="<?php the_title(); ?>"><?php the_title(); ?> <span class="uk-text-small uk-text-muted"><?php the_date('Y-m-d', '[', ']'); ?></span></a></div>
</div>
<?php endif; $i++; ?>
<?php endwhile; ?>
<?php echo get_field('text_after_post_programs', $taxonomy . '_' . $term_id); ?>
Подскажите пожалуйста, как мне узнать с помощью Inspect Element, в каком именно файле прописаны слова View my Wishlist?
Я конечно могу взять Notepad++ и найти те 9 файлов где это слово прописано.
// retrieves the attachment ID from the file URL
function pippin_get_image_id($image_url) {
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
return $attachment[0];
}
// set the image url
$image_url = 'http://yoursite.com/wp-content/uploads/2011/02/14/image_name.jpg';
// store the image ID in a var
$image_id = pippin_get_image_id($image_url);
// retrieve the thumbnail size of our image
$image_thumb = wp_get_attachment_image_src($image_id, 'thumbnail');
// display the image
echo $image_thumb[0];
img {
max-width: 120%;
margin-left: -10%;
margin-right: -10%;
height: auto !important;
}
add_action('init', 'register_posttype');
function register_posttype() {
$labels = array(
'name' => __('Shortcodes', 'dco-sm'),
'singular_name' => __('Shortcode', 'dco-sm'),
'menu_name' => __('Shortcodes', 'dco-sm'),
'all_items' => __('DCO Shortcodes Menu', 'dco-sm'),
'add_new' => __('Add New', 'dco-sm'),
'add_new_item' => __('Add New Shortcode', 'dco-sm'),
'edit' => __('Edit'),
'edit_item' => __('Edit Shortcode', 'dco-sm'),
'new_item' => __('New Shortcode', 'dco-sm'),
'view' => __('View', 'dco-sm'),
'view_item' => __('View Shortcode', 'dco-sm'),
'search_items' => __('Search Shortcode', 'dco-sm'),
'not_found' => __('No Shortcodes found', 'dco-sm'),
'not_found_in_trash' => __('No Shortcodes found in Trash', 'dco-sm'),
);
$args = array(
'labels' => $labels,
'description' => __('Custom post type for DCO Shortcodes Menu', 'dco-sm'),
'public' => false,
'show_ui' => true,
'show_in_rest' => false,
'has_archive' => false,
'show_in_menu' => 'myplugin-admin.php',
'show_in_admin_bar' => false,
'exclude_from_search' => false,
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
'supports' => array('title'),
);
register_post_type('dco_shortcode', $args);
}
function wpdocs_register_my_custom_menu_page() {
add_menu_page(
__( 'Custom Menu Title', 'textdomain' ),
'custom menu',
'manage_options',
'myplugin-admin.php',
'',
plugins_url( 'myplugin/images/icon.png' ),
6
);
}
add_action( 'admin_menu', 'wpdocs_register_my_custom_menu_page' );