Are you the publisher? Claim or contact us about this channel

Embed this content in your HTML


Report adult content:

click to rate:

Account: (login)

More Channels


Channel Catalog

Channel Description:

WordPress › Support

older | 1 | .... | 317 | 318 | (Page 319) | 320 | 321 | .... | 413 | newer

    0 0

    I have been using HESK for years. It has no wordpress plugin which sucks but no support program made for wordpress has its great features.

    I need to use HESK as a bug reporting/tracking system. I have had to devise a way to pass information to HESK from wordpress using this link:

    <a href="
    <?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>
    &category=10&name=<?php $current_user = wp_get_current_user();
    echo $current_user->user_firstname . '&nbsp;';
    echo $current_user->user_lastname . '&email=';
    echo $current_user->user_email . '&custom2=';
    echo $current_user->user_login;?>
    &subject=I%20found%20a%20bug!%20Squash%20it%20please." target="_blank">Report a Bug</a>

    That works just fine, but here is the problem.
    I really need the link to be available on every page of each site for logged in users. I figure the best way to do this is to have it appear on the admin bar.

    I am trying to make a simple plugin that will allow me to make this addition to the admin bar and all I have found on the internet are ways to add a static link up there. Example below:

    add_action( 'admin_bar_menu', 'toolbar_link_to_mypage', 999 );
    function toolbar_link_to_mypage( $wp_admin_bar ) {
    	$args = array(
    		'id'    => 'my_page',
    		'title' => 'My Page',
    		'href'  => '',
    		'meta'  => array( 'class' => 'my-toolbar-page' )
    	$wp_admin_bar->add_node( $args );

    I am not very good in PHP yet and I have tried so many different ways to get my link to work on the admin bar with no success.

    Does anyone know how to get a dynamic link like mine onto the admin bar?

    0 0

    I am trying to add an option for upgraded shipping to my site. From my searching it seems like the proper way (currently) is to add the following code to my functions.php file

    add_action( 'woocommerce_flat_rate_shipping_add_rate', 'add_another_custom_flat_rate', 10, 2 );
    function add_another_custom_flat_rate( $method, $rate ) {
    	$new_rate          = $rate;
    	$new_rate['id']    .= ':' . 'custom_rate_name'; // Append a custom ID
    	$new_rate['label'] = 'Rushed Shipping'; // Rename to 'Rushed Shipping'
    	$new_rate['cost']  += 2; // Add $2 to the cost
    	// Add it to WC
    	$method->add_rate( $new_rate );

    This seems to be working, but when the new option is selected, the new one disappears and the list reverts back to only the one option available.

    Is this a compatibility issue with my theme (optimizer)? Have I done something wrong? All help is greatly appreciated!

    0 0

    I am trying to run the loop showing 4 posts, which goes into a bootstrapped tablist, then show the next 4 posts in a tabbed list and so on.

    the logic is messing my brain - here is where I am at.

    $ingredients = new WP_Query('cat=6&showposts=-1');
    $a = query_posts('category_name=my_category');
    $result = count($a);
    $count = 1;

    $i = 1;
    while (have_posts() && $i < 5) : the_post(); ?>

    <?php if ($i == 1) echo '<ul class="nav nav-tabs" role="tablist">' ?>

    <li >" role="tab" data-toggle="tab" rel="bookmark" title="<?php the_title(); ?>"><?php echo get_the_post_thumbnail( $post_id, array( 100, 100) ) ?>
    <?php echo the_title(); ?>

    <?php $i++; endwhile; ?>


    echo '<div class="tab-content">';
    $ingredients = new WP_Query('cat=6&showposts=-1');

    while($ingredients->have_posts()) : $ingredients->the_post();
    <div role="tabpanel" class="tab-pane fade in " id="<?php the_ID(); ?>"><?php the_content(); ?></div>

    <?php endwhile; ?>


    Little bit of a newbie here and just cannot figure out the count.
    Any help would be appreciated.

    0 0

    I have this custom field with the name "en_proceso_class" and the value "en_proceso". It was supposed to add a class to a div element in my post query.

    // Get post meta that is already set
    $custom_values = get_post_meta($post->ID, 'en_proceso_class', true);?>
    <div class="postthumbnail <?php echo $custom_values; ?>">

    But the problem is that if you are on a new post and the custom name "en_proceso_class" is there but the value is empty, I don't want the client to add anything to the class since it's already styled. I thought it's best to convert this into a checkbox. It would be something like "Please check if you want the post to be in process" which will add the class to the post. I did research and again was confused by all those researching... Text field were simple but checkboxes were complicated

    Here's the code in functions.php that are half working. It works in that it adds class, sort off, but the checkbox isn't working by unchecking and checking the box everytime you update. Additionally, when I make a new post, the class is added even when I made sure that I didn't check the box when I published the post. Could you check what's wrong with the code.

    add_action( 'add_meta_boxes', 'cd_meta_box_add' );
    function cd_meta_box_add()
        add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );
    function cd_meta_box_cb()
        // $post is already set, and contains an object: the WordPress post
        global $post;
        $values = get_post_custom( $post->ID );
        $text = isset( $values['my_meta_box_text'] ) ? $values['my_meta_box_text'] : '';
        $check = isset( $values['en_proceso'] ) ? esc_attr( $values['en_proceso'] ) : '';
        // We'll use this nonce field later on when saving.
        wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );
            <input type="checkbox" id="en_proceso_class" name="en_proceso_class" <?php checked( $check, 'on' ); ?> />
            <label for="en_proceso_class">Please check if this is in process</label>
    add_action( 'save_post', 'cd_meta_box_save' );
    function cd_meta_box_save( $post_id )
        // Bail if we're doing an auto save
        if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
        // if our nonce isn't there, or we can't verify it, bail
        if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;
        // if our current user can't edit this post, bail
        if( !current_user_can( 'edit_post' ) ) return;
        // now we can actually save the data
        $allowed = array(
            'a' => array( // on allow a tags
                'href' => array() // and those anchors can only have href attribute
        // This is purely my personal preference for saving check-boxes
        $chk = isset( $_POST['en_proceso_class'] ) && $_POST['my_meta_box_select'] ? 'on' : 'en_proceso';
        update_post_meta( $post_id, 'en_proceso_class', $chk );

    By the way, I got that from this tutsplus tutorial,

    0 0


    i am in a bit strange situation: we cannot fully switch to WP from old CMS by my client desire. We only need to override current CMS (not WP) homepage with WordPress. We have to leave the old CMS intact, so i am thinking about creating index.html (which is loaded first by server) and rename WP index.php (i know it won't be simple). Best case scenario if we could upload WP to other then root directory to have less mess with other cms.

    Maybe someone were in similar situation? Any ideas? Thanks.

    0 0

    Hi, I'm developing a site in which users are limited to edit posts and terms assigned to a certain custom taxonomy terms, like this:
    Group taxonomy:
    - Department 1
    - Group 1.1
    - Sub_term 1.1.1
    - Sub_term 1.1.2
    - Group 1.2
    - Sub_term 1.2.1
    - Sub_term 1.2.2
    - Group 1.3
    - Sub_term 1.3.1
    - Sub_term 1.3.2
    - Department 2
    - Group 2.1
    - Sub_term 2.1.1
    - Sub_term 2.1.2
    - Group 2.2
    - Sub_term 2.2.1
    - Sub_term 2.2.2
    - Group 2.3
    - Sub_term 2.3.1
    - Sub_term 2.3.2

    Second level terms (Group x.x terms) are assigned to users saving a user_meta value, so users can only view and edit posts in assigned terms or its children (with pre_get_posts action) and can only view and edit the assigned term or its children (with get_terms_args filter).

    I've modified terms args like this:

    add_filter( 'get_terms_args', 'icb_filter_get_terms_args', 10, 2  );
    function icb_filter_get_terms_args( $args, $taxonomies ) {
        if ( $taxonomies[0] == 'grupo_inv' ) {
    		$user_group = get_user_group(); // int val. Gets assigned term, stored in user_meta. Returns false if no assigned group
    		if (is_admin() && $user_group) {
    			$args['child_of'] = $user_group;
    	return $args;

    It's almost working, but terms list table in admin is not populating at all (it's empty and it's not showing any "no items found" message), and terms count above table shows all terms count (20 in this case) instead term children count (2).

    Nevertheless, terms dropdown for parent term selection and terms checklist in post edit screen are filtered properly.

    Can't anybody help me?
    Thanks in advance

    0 0


    I am new with WP development and trying to create WP plugin.

    The thing I need to do is to add a html tag buttons for default text widget with ready made html templates when the user press the button. I already got the buttons, but what I can't figure out what filter/action(or none of them) should I use to make that html template (for example <div></div>) to appear into wordpress text widget's content text field?

    Thanks in advance!


    0 0

    Hi there!

    Anyone add an action hook so I can display on the front end form a list of a certain custom post type? (Like the fields for taxonomies).

    Any clue?
    All best!

    0 0

    I have a page, I have a menu structure, and I am able to get to the single menu item that represents the page I'm considering.

    I want to get to the topmost parent of that menu item (and then to its page).

    I can do it by hand, but I was trying to use get_ancestors() like it is suggested here:

    After your edit I see you want the top level parent. So get_ancestors() could be helpful to you, to get the top parent. $item->ID can be used as $object_id and nav_menu_item as $object_type. get_ancestors() returns an array. Use array_reverse on it to have the top level ancestors ID at index 0.

    But as a commenter noted the returned array is empty.

    I thought that menu structures were taxonomies, am I wrong?

    I'd like not to reinvent the wheel if possible.

    is lagging behind code:

    anyway tracing source code
    get_term($menuItem->ID, 'nav_menu_item'); generates an invalid_taxonomy error

    Why is that?

    0 0

    Hello all
    I have a college project to build a simple search engine plugin from scratch. It needs to have a form where the user can type in a serial number to search for a matching serial number on the DB.
    I have created a simple search engine before in regular PHP but 'plugifying' it is giving he serious heartache as I am a noob to WP
    Can anyone help or point to a resource that will give me a good idea how to go about the task?

    Thank you

    0 0

    Hello, I'm fed up of spam users.There are too many users are being registered in my wp_users table automatically, I used many plugins like wordfence, stopspammers, wanggaurd etc. but they are not prevented yet.I applied some .htaccess rule to prevent them but still not prevented, and in this I'm facing 500 internal server error.Plz suggest me what should I do?

    0 0

    I'm using multisite, and I'm getting a lot of users' registrations daily, tried many things to solve this, I didn't get rid off from this but now 'm facing 500 internal server error, I searched for this error so I found that may be some .htaccess rules are not correct or .htaccess files corrupted, so I changed the .htaccess file and also changes the rules but not solves yet.
    Please help me, I'm fed up of this.

    0 0

    Hello, I think our website has been hacked. There are links popping up to different websites that has nothing to do with our organization and a few are very inappropriate. Please, how can we get these links off our site and ensure that this does not happen again if someone could get back to me as soon as possible.


    0 0

    I have created custom post type called as "shops". Under this type I have categories like computer shops, cellphone shops, cloths shops etc.
    I want to show this categories on a static page.
    How can I show them on a page?

    0 0

    The forums thoroughly document the process of calling multiple tags in a URL with commas and plus signs ... but what I need is to display all the posts with a certain tag followed by posts with another tag followed by posts with another tag and so on.

    Ideally I'd like to accomplish this with a single URL ( won't work because the results page displays posts with those tags mixed together in order of publishing date) but am open to updating my functions.php file with some magic. And, yes, I'm using permalinks.

    Please help!

    0 0
  • 11/11/15--02:25: Marcin on "Creatign plugin"
  • Hi,
    I'm creating a plugins. Works well but I have to add created tab/functionaliy not only to admin. I read manuals, watched tutorials and checked how are another plugins coded but I can't find this command.

    The begining of my plugins is like that:

    // Hook for adding admin menus
    add_action('admin_menu', 'ekspertyzy');
    // action function for above hook
    function ekspertyzy() {
    // Add a new top-level menu (ill-advised):
    add_menu_page(__('Ekspertyzy'), __('Ekspertyzy'), 'manage_options', 'eksperises', 'ekspertyzy_page' ,'',4);
    wp_register_style('myStyleSheet', plugins_url('/ekspertyzy/a_styles.css'), __FILE__);
    wp_enqueue_style( 'myStyleSheet');
    // mt_toplevel_page() displays the page content for the custom Test Toplevel menu
    function ekspertyzy_page() {
    //here a code for plugin...

    I was trying to replace

    add_action('admin_menu', 'ekspertyzy');

    with something like

    add_action('admin_menu, author_menu', 'ekspertyzy');

    but didn't find right command.

    How can I implement this for authors? Not only for admin.

    0 0


    I have a problem with a website I own and which I "upgraded" with some specific scripts I wrote. On a page, I have a module which is loaded in a iframe, with a JS script inline function that crops parts of the page shown in the iframe. It works perfectly on computers, but when you switch to mobile devices, the cropping function does not seem to launch properly.

    Does someone has a clue about it ?

    Thanks you,

    Eliott C.

    0 0

    Ok I am having an issue with a WordPress site. I am trying to show the posts as excerpts, which is working. But, I want the title to be a link just like the read more text. I have successfully changed the title to a link, but when clicked, it just adds the_permalink(); to the end of the url and I get the 404 page. Here is a snippet of the code from the loop. This is where the issue lies. This code resides in archive.php in the twentyfourteen theme. Hoping someone can help! Thanks!

    // Start the Loop.
    while ( have_posts() ) : the_post();
    // Displays posts as excerpts
    the_title('<a href="the_permalink();"><h2 style="text-transform:uppercase;">','</h2></a>');

    0 0

    Hello All: We're new to Wordpress & have a question: We have our WordPress site hosted at host A, and we a secondary "members only" site hosted at host B under a different domain. Is it possible for us to allow the wordpress site handle the authentication so that we could, for example, have a link on the wordpress site that will direct users to the members only section of site B, and somehow securely provide information for the user logged in (providing the email address and username only) so they won't have to login again?

    Any & all advice is greatly appreciate. Thanks in advance!

    0 0


    I would like to show my custom post type ordered by category (custom taxonomy)on a page, if possible also with the category name above the posts. But i dont know how i can do this. does anyone know the solution for this?

    <?php $my_query = new WP_Query( $args = array(
    'post_type' => 'cupcakes',
    'taxonomy' => 'cupcake_category',
    'field' => 'slug',
    'terms' => 'specials')
    $query = new WP_Query( $args ); ?>
    <?php get_header(); ?>
    <section id="primary" class="content-area">
    <div id="content" class="site-content" role="main">
    <?php if ($my_query-> have_posts() ) : ?>
    <header class="page-header">
    <h1 class="page-title"></h1>
    </header><!-- .page-header -->
    <div class="archive-posts">
      <header class="entry-header">
    	<h1 class="entry-title"></h1>
    		</header><!-- .entry-header -->
    			<?php /* Start the Loop */ ?>
    <?php while ($my_query-> have_posts() ) : $my_query->the_post(); ?>
    <?php get_template_part( 'content', 'page-cupcakes');?>
    <?php endwhile; ?>
    <?php snaps_content_nav( 'nav-below' ); ?>
    <?php else : ?>
    <?php get_template_part( 'no-results', 'archive' ); ?>
    <?php endif; ?>
    </div><!-- #content .site-content -->
    </section><!-- #primary .content-area -->
    <?php get_footer(); ?>

    This is how it looks so far (this is a created archive-cupcake.php file)

older | 1 | .... | 317 | 318 | (Page 319) | 320 | 321 | .... | 413 | newer