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 | .... | 381 | 382 | (Page 383) | 384 | 385 | .... | 413 | newer

    0 0

    Hi all,

    I'm hoping someone can give me advice on this. I have a JavaScript function that used to work, and now it doesn't. On this page: when you check "Advanced Search", a hidden div is supposed to show.

    Here is the function:

    $('#advanced-options').on('change', function() {
       $.cookie('advanced-search', $(this).is(':checked')?'1':'0');
       if($(this).is(':checked')) {
       } else {
       if($.cookie('advanced-search') == '1') {
            $('#advanced-options').prop('checked', true).trigger('change');

    I'm on WP Engine and recently learned that they block certain cookies. They assured me that's not what's happening here. I'm not sure why this isn't working. Any help would be appreciated.

    0 0

    I have a working drag and drop system that uploads an image to Imgur from the users hard drive, the code is shown below.

    How can I modify this code so instead of using an image from a users HD, each thumbnail from old and new galleries get an "Upload to Imgur" button which sends the full size image to Imgur where the user in turn can use their image editing services.

    Or iw there a WP plugin that already does this?

    `<div>DROP!<button onclick="document.querySelector('input').click()">Or click</button></div>
    <input style="visibility: collapse; width: 0px;" type="file" onchange="upload(this.files[0])">

    It's online!!!


    /* Drag'n drop stuff */
    window.ondragover = function(e) {e.preventDefault()}
    window.ondrop = function(e) {e.preventDefault(); upload(e.dataTransfer.files[0]); }
    function upload(file) {

    if (!file || !file.type.match(/image.*/)) return;
    document.body.className = "uploading";

    var fd = new FormData();
    fd.append("image", file);
    var xhr = new XMLHttpRequest();"POST", "");
    xhr.onload = function() {
    document.querySelector("#link").href = JSON.parse(xhr.responseText);
    document.body.className = "uploaded";

    xhr.setRequestHeader('Authorization', 'Client-ID');


    0 0

    I need to be able to load up wordpress and load up the theme, but i dont want to perform any queries against the WP database for posts. I have a custom php file that gets a post from a non WP database. I have setup the htaccess file to correctly route this. The top of the script loads wordpress.


    From here i get the global $post object and populate it with the custom data that i want to display on the page. I also need to alter the response http code since calling wp-blog-header.php generates a 404 error since no post was found. I need to cut this part out, but still load up wordpress.

    After populating $post i call the theme to render the post using the wordpress theme.

    include get_template_directory()."/page.php";

    This is working fine in web browsers. I have fixed all issues and it renders great, but search engines and bots have trouble with it. For example, if the url of the page is, wordpress checks for a post with a slug that contains this value. 90% of the time it doesnt find a post and generates a 404, which i am able to handle. 10% of the time it finds a similar slug. eg. "somethingelse" and performs a 301 redirect which is causing a lot of trouble.

    How can i load up wordpress and be able to call the theme without it querying the wordpress DB for a post?

    0 0

    Hi, I'm using Imagemapster for adding a hover effect to my header image. I successfully load the imagemapster.js, my script (also .js in theme folder), but nothing seems to happen. I've already digged around on Google for answers, and I've found nothing that works.
    Here's the code:
    jQuery(document).ready(function($) {
    singleSelect : true,
    clickNavigate : true,
    mapKey: 'color',
    fill : true,
    altImage : 'wp-includes/images/files/posaoodkuce-nav-image-hover.gif',
    fillOpacity : 1,

    here's the site:

    0 0

    need help.

    Those are errors:!iBA2hYDB!WayC-AWYO4PafNZ9f6kyoeaUicaYn-mWtJtMVillfDo

    and this is code :

    $dropdown_cities = array_reduce( $cities, 'array_merge', array() );
    					sort( $dropdown_cities ) ;
    				foreach ( $dropdown_cities as $city_name ) {

    What should I correct here?


    0 0


    I've modified My Wish List plugin. Users have a possibility to choose certain amount of products/gifts (for example 4 of 10). I would like to have a script to calculate the maximum value for the amount field. However I don't know how to get the values from 'total' and 'reserved' variables for the calculation operation.

    if( $meta['reserved'] < $meta['total'] ) {
    	if( $wishlist_show_form == "show" ) {
    		$output .= '<form method="post" action="" class="wishlist-form">';
    		$output .= '<table>';
    		$output .= '<tr><td><span class="wishlist-form-label">Name:</span></td><td><input name="wishdonorname" type="text" class="wishlist-form-input" /></td></tr>';
    		$output .= '<tr><td><span class="wishlist-form-label">E-mail:</span></td><td><input name="wishdonoremail" type="text" class="wishlist-form-input" /></td></tr>';
    		$output .= '<tr><td><span class="wishlist-form-label">Amount:</span></td>
    <input name="reserved" id="reserved" type="number" min="1" class="wishlist-form-input" />
    <script type="text/javascript">
    var input = document.getElementById("reserved");

    0 0

    Hi, this may be a trivial thing but I searched and wasn't able to find a thing about it. When someone installs my plugin and tries to activate, I want to ask for username and password, and block the activation if it's wrong. I messed with register_activation_hook a little bit, but wasn't able to come with anything. Is it possible, and if so, how? Thanks.

    0 0


    I have some intrusion atempts on my blog that ends by 404 http status.

    So i built a script that cacth the requested url and then it checks if there is a chain corresponding to "/wp-includes/" or "/wp-content/" in it.

    Finally it adds a "deny the client IP line" in htaccess when this happend to be true.

    All is good when typing an url in browser in this case.

    But I need this script to be on a lower level, before template loadings, even before the server sends the HTTP status header 404 code to the client.

    Is there way to do that whitout having wordpress updates erasing the hack. Maybe with templates functions ?

    I've seen these functions that looks intersting :

    I'm not a strong developer and english is not my first language,
    Thanks for your help, and sorry if i wrote mis-spelings,

    0 0


    I am trying to dynamically pull the logged in user's email address into a form before it is submitted. Here is the code:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <form method="post" ><input id="email" name="user_email" type="hidden" value="LOGGED IN USER EMAIL HERE" />
    <input type="submit" value="Register for webinar" /></form>

    Any idea how I do this without php?


    0 0

    How to remove this script in the wp-footer:


    wp_deregister_script( 'wp-embed.min.js' );
    wp_deregister_script( 'wp-embed' );
    wp_deregister_script( 'embed' );

    Do not work -.-

    0 0

    Hi, I want to auto run our backup scripts before plugin/core or any update happens, either auto or manually.
    What triggers when WP is updating?

    0 0

    Hello everyone,

    I have issue I've been struggling few days already and couldn't find a problem so I hope someone has an idea.

    We have our own page builder for all our buyers so they can build pages easily. Problem I encounter is that when user adds new element to page builder grid and try to preview the results, hook "save_post" doesn't fire. Actually it fires every second time.

    I search all over the web and my conclusion is:
    - when user clicks on Preview Changes, WordPress store post Revision
    - Hook "save_post" will fire only when there are changes in WordPress editor. Because user is adding content through page builder and nothing actually changes in WP Editor those changes are not detected.

    I tried changing tinyMCE "isDirty" parameter on two different ways when user adds content to page builder:

    tinyMCE.activeEditor.isNotDirty = false;

    Neither is working.

    I assumed that changing this parameter when user adds new element to page builder will force firing save_post hook every time but unfortunately it doesn't.

    I also tried to track "save_post" hook in WordPress core files to find how and when it fires but this ended without results.

    I think that page builder is not important at all in this case as I actually need (probably) to simulate change in WP Editor to force save_hook to fire.

    I am out of ideas so I would appreciate if someone has idea how to resolve this.

    Thank you,

    0 0

    I'm using a custom front end publishing form on my website using wp_insert_post, based on this article.

    It works perfectly when I put this code inside a page, but when on the front-end page (homepage), archive page and search page, it doesn't work, and when I submit the form, I'm redirected to an archive.php page, the archive page from the post_category I've chosen in my form.

    I think there might be a conflict with my submit button, I really don't know what's happening.

    anyone can help me with this ?

    here is my code

    if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {
      // Do some minor form validation to make sure there is content
      if (isset ($_POST['title'])) {
        $title =  $_POST['title'];
      } else {
        echo 'veuillez entrer un titre';
      if (isset ($_POST['description'])) {
        $description = $_POST['description'];
      } else {
        echo 'veuillez entrer du texte';
      $genre = $_POST['genre'];
      $tranche_age = $_POST['tranche_age'];
      // ADD THE FORM INPUT TO $new_post ARRAY
      $new_post = array(
      'post_title'  =>  $title,
      'post_content'  =>  $description,
      'post_category' =>  array($_POST['cat']), // Usable for custom taxonomies too
      //'tax_input' => array( 'regions' => '14' ),
      'post_status' =>  'publish',           // Choose: publish, preview, future, draft, etc.
      'post_type' =>  'post',  //'post',page' or use a custom post type if you want to
      //'genre'  =>  $genre,
      //'tranche_age'  =>  $tranche_age,
      $pid = wp_insert_post($new_post);
      $link = site_url();
      wp_redirect( $link );
      //add_post_meta($pid, 'genre', $genre, true);
      //add_post_meta($pid, 'tranche_age', $tranche_age, true);
    do_action('wp_insert_post', 'wp_insert_post');
        <div id="container">
          <div id="content" role="main">
        <!-- FRONT END PUBLISHING -->
        <div class="wpcf7">
        <form id="new_post" name="new_post" method="post" action="" class="wpcf7-form" enctype="multipart/form-data">
          <!-- post name -->
          <fieldset name="name">
            <label for="title">Titre:</label>
            <input type="text" id="title" value="" tabindex="5" name="title" />
          <!-- post Category -->
          <fieldset class="category">
            <label for="cat">Catégorie :</label>
            <?php wp_dropdown_categories( 'tab_index=10&taxonomy=category&hide_empty=0&show_option_all=Choisissez une catégorie' ); ?>
          <!-- post regions -->
          <fieldset class="regions">
            <label for="regions">Région :</label>
            <?php wp_dropdown_categories( 'name=regions&tab_index=10&taxonomy=regions&hide_empty=0&show_option_all=Choisissez une catégorie' ); ?>
          <!-- post Content -->
          <fieldset class="content">
            <label for="description">Question :</label>
            <textarea id="description" tabindex="14" name="description" cols="80" rows="10"></textarea>
          <!-- Genre -->
          <input type="hidden" id="sexes" name="sexes" value="26" />
          <!-- Tranche d'âge -->
            <?php $date_of_birth = um_user('birth_date'); $age =  CalculateAge($date_of_birth); ?>
            <?php if ($age >= 18 && $age <= 25) :?>
            <input type="hidden" value="28" id="ages" name="ages" />
            <?php endif; ?>
            <?php if ($age >= 26 && $age <= 35) :?>
            <input type="hidden" value="29" id="ages" name="ages" />
            <?php endif; ?>
            <?php if ($age >= 36 && $age <= 45) :?>
            <input type="hidden" value="30" id="ages" name="ages" />
            <?php endif; ?>
            <?php if ($age >= 46) :?>
            <input type="hidden" value="31" id="ages" name="ages" />
            <?php endif; ?>
          <fieldset class="submit">
            <input type="submit" value="Envoyer" tabindex="40" id="submit" name="submit" />
          <input type="hidden" name="action" value="new_post" />
          <?php wp_nonce_field( 'new-post' ); ?>

    0 0

    Most of our users using the wrong setting for there new post. Their messages contains different pictures (20).

    I wonder if it is possible that we can changes 'AD MEDIA' to the option 'AD GALLERY'?


    0 0

    I'm probably being dense, but I can't seem to figure out what the issue here is.

    The site I'm developing uses a custom loop, with a query that excludes any posts ticked as archived.

    The reason I want to edit the tag.php template is to output custom meta to the front end, and tweak the appearance of all posts on the archive pages.

    It works perfectly for the majority of the site, but on tag.php it causes to tag cloud to break, making any and every tag clicked bring up the full post list.

    When I remove the query the tag cloud works fine, but archived posts are still displayed and aren't laid out the way they need to be.

    The query code I'm using is:

    // The Queries
         $args = array(
    	'post_type' => array('post', 'report', 'analysis', 'guest-blog'),
    	'order'     => 'DESC',
    	'meta_query'     => array(
    		'key'     => 'epi_pubarchive',
    		'value'   => 1,
    		'compare' => '!=',
         $the_query = new WP_Query( $args );

    The meta key, epi_pubarchive, is a checkbox created using Meta Box, essentially checking if the box is ticked or not.

    I've tried removing the meta_query and trying it with the basic post_type and order args, but that won't work either.

    Anyone know what the issue with tags and queries is?

    Is there a better way to achieve the desired result?

    0 0

    I'm running into kind of a consistent, recurring problem with my plugin and other plugins including JQuery UI.

    My plugin displays dialogs, so I enqueue the appropriate javascript and wp-dialog CSS files.

    However other plugins are including their own copy of JQuery-UI.css which causes the dialog to display incorrectly. You can see and example here:

    click on one of the anniversary names. Here's another thread where I worked with another plugin vendor:

    I understand why people are doing this. I tried to use the JQuery UI Datepicker, and was stymied because WP doesn't include the required CSS to make it work. That was super-frustrating because WP explictly names out the jquery-ui-datepicker as a script to be loaded.

    I tried loading my own copy of JQuery UI.css from a CDN and I ran into the same problem.

    I understand the issue with including a JQuery-UI theme because it might not match the WP theme at all, making people really unhappy.

    Is this kind of problem solvable? I'm more of a back-end developer. Could a system be created to dynamically generate a complete JQuery-UI css file using hints provided by the theme? That way a themed, functionally complete JQuery UI CSS file could be delivered?

    0 0

    Hi everyone,

    How can I remove or disable update button in publish section for specific user like (Editor), I just want the user be able to click on preview not Update.

    anyone knows any trick or any plugins or anything that could help me in this way?

    I really appreciate your time,

    Kind regards

    0 0

    I need to add a custom field to the edit category page, and cannot find what hooks should I use for doing that.
    I need to add a simple checkbox and save the user choice into the options page.

    Any suggestions is welcome

    0 0

    Hello !

    I am trying to retrieve all user meta (in columns) for each users (in rows).

    I build (not without pain) this query that is working in phpmyadmin :

    SET group_concat_max_len=16384;
    SET @sql = NULL;
    	  'MAX( IF ( M.meta_key = ''',
    	  ''', M.meta_value, NULL)) AS `',
    	  meta_key, '`'
      ) INTO @sql
    FROM wp_usermeta;
    SET @sql =
    CONCAT( ' SELECT *, ', @sql,
    ' FROM wp_users as U, wp_usermeta as M
    WHERE = M.user_id
    GROUP BY ' );
    PREPARE stmt FROM @sql;
    EXECUTE stmt;

    But when I execute it with $wpdb->get_results, it returns an empty array.

    Anyone can help ?

    0 0


    I wrote a plugin that uses WP_Query to display some posts, depending of the users choices. The query is made on taxonomies.
    It's working pretty well, but the only thing I'm not able to achieve is the order of the results.
    I'd like to sort the results by catagory names, but it's not working...
    In the args, here's what I wrote:

    'orderby' => 'category',
    'order' => 'asc',

    I don't understand what's wrong. Could anybody help me?

older | 1 | .... | 381 | 382 | (Page 383) | 384 | 385 | .... | 413 | newer