Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

bungeebones on "Page template use in plugin development"

$
0
0

A quick question about page templates.

I built a plugin that is severely messed up by a right hand side bar and when discussing the possibility of disabling it from the plugin, someone suggested I use a page template where the plugin installs to.

I'm looking at that but it seems doing that would mean the user would need to upload the page template to their theme folder.

Is that correct? Would a user have to load the page template to their theme folder?

I'm not sure if I want to have the installer go to that trouble quite yet and prefer an easier installation system if there is one.

Thanks in advance.


j.etter on "Change url of next_post_link, previous_posts_link"

$
0
0

I'm trying to change the link of next_posts_link from './page/2/' to '.?paged=2' and similarly for previous_posts_link.

I've been struggling through information I've found online to no avail for the last few days. Anyone know how to do this? Thanks so much.

aaronjcrawford on "Edited code, crashed my site"

$
0
0

Hello,
I was receiving the "cheating uh" dialog box anytime I tried to upload media to the Discover theme and attempted to correct the issue with the fix on this website.
http://www.techknot.com/how-to-fix-cheatin-uh-error-in-wordpress/

I edited the open medialibrary-uploader.php file and now I receive the following message when I try to login:

Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in /home/content/44/11337144/html/wp-content/themes/discover/admin/options-medialibrary-uploader.php on line 169

Please help! I have no idea on how to even get back into my dashboard to try to fix the code.
The site is
http://bekoconstruction.ca/

Thank you,

kiannarexia on "Displaying Child Taxonomies in form dropdown when parent is selected"

$
0
0

Hi there,

I am working with a friend/client on a website that is essentially a collective of brands and companies who manufacture their goods in the US. I've created this site using a custom post type for each brand as well as taxonomies that categorize the brand's product qualities and types of products sold as well as their location depending on region, state, and city.

Ideally, we would like to have a search function that allows users to filter their search depending on any of these taxonomies. I've just installed the Filter & Search plugin and it works absolutely perfectly. I'm just trying to figure out one thing...

Right now, I have a single taxonomy for "Location" where cities are listed under their respective states as child taxonomies. I was wondering if anyone has any know-how or resources that might help me with creating two dropdowns- one for the parent terms in the location taxonomy, or "States" and a second one that would display the states child "Cities". So selecting "Texas" in the first dropdown would then render cities like "Austin" "Dallas" and "Houston" in the second. Not selecting a state at all would just leave the city dropdown blank essentially.

I know this has to be possible, and I'm willing to put work into the customization to make it work, I'm just not 100% sure where to start. Any ideas or leads would be greatly appreciated. Thanks everyone!

ketoweb on "Add Links to Footer of Every WPMU website of mine"

$
0
0

Hello,

I am currently running a WPMU website, and I would like to add links such as "Privacy Policy, About us, Contact us" etc etc in the footer of all my sites that are under the network. Since creating pages on each of them will be a pain.

Please help me out with this.

sv2agw on "xmlrpc newPost locale problem"

$
0
0

Hi

I am posting ok either using metaWeblog.newPost or wp.newPost.
The problem is that because Title and Content are in Greek the post has not Greek letters but something else no one can understand.
It is like conversion from xml to utf-8 failed.
the xml looks like this
<name>description</name><value> Áðü áíáìì
any help?

thank you in advance
George

pinchbeck on "custom real estate plugin => how to do it"

$
0
0

Hi all,
i'm relatively new to wordpress theme/plugin development. So first, i'm going to tell you what i want to do and then, hopefully, you are going to tell me what the right - wordpress - way of doing it is.

I would like to create a real estate web presentation, showing a few properties:
* the properties should be imported by a cronjob
* the properties should be stored in an extra table
* there should be an overview-page containing all properties, with the possibility of filtering / searching them
* there should be a details page, showing the properties details

Here are my questions:
1. Which page should be called to start the cronjob? Should i just create a custom page with a special theme, that triggers the import, or is there another option?

2. How would you create such a plugin? After doing the cronjob as supposed in 1. i would just use a custom theme to loop over the db entries and showing them. What is the wordpress way of solving such a task?
I don't think i need a custom post type, since the properties are not created with wordpress, but just displayed from the database.

Many thanks in advance,

pinchbeck

cflavs on "From Bootstrap to WordPress"

$
0
0

Hi all,

I build a Template using Bootstrap which fully works outside WordPress but now I want to use this template in WordPress and it´s not working.
So far I added the Twitter Bootstrap CSS plugin into my page and actived all functions, so the grid system, navbar etc is working with no problems.
The carousel on the other hand itsn´t working, first of all when I try to create a sidebar-carousel.php, I put the carousel that I did there and that´s what I get here

So I tried to put all the code in my header.php file and that´s my current website
As you can see, the image on slide 1 appears, and if I activate subtitles it´ll also work, but I don´t have arrows and it doesn´t goes to slide 2 at all.

THe following lines has the carousel code that I´m using and the final scripts on index.php. If anyone here has any idea of how to fix that it´ll be grand.

<!-- Carousel
    ================================================== -->
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
      <!-- Indicators -->
      <ol class="carousel-indicators">
        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
        <li data-target="#myCarousel2" data-slide-to="1"></li>
        <li data-target="#myCarousel3" data-slide-to="2"></li>
      </ol>
      <div class="carousel-inner" role="listbox">
        <div class="item active">
          <img src="<?php bloginfo('template_directory'); ?>/imagens/manta.jpg" alt="Logo" />
          <div class="container">
            <div class="carousel-caption">
             <!-- <h1>Example headline.</h1>
              <p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p>
              <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>-->
            </div>
          </div>
        </div>
        <div class="item">
          <img src="imagens/vermiculita.jpg" alt="Second slide">
          <!--<div class="container">
            <div class="carousel-caption">
              <h1>Another example headline.</h1>
              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
              <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
            </div>
          </div>
        </div> <!--
        <div class="item">
          <img src="" alt="Third slide">
          <div class="container">
            <div class="carousel-caption">
              <h1>One more for good measure.</h1>
              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
              <p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p>
            </div>
          </div>
        </div>
      </div> -->
      <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
      </a>
    </div><!-- /.carousel -->

E os scripts

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="../../dist/js/bootstrap.min.js"></script>
    <script src="../../assets/js/docs.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
    $('.carousel').carousel({
  		interval: 1000
  	})
});
</script>
<?php get_footer(); ?>

LoganCA on "Admin added to wordpress site by hacker"

$
0
0

There was a new Admin added to my Wordpress site which is controlling my site now. I still have my Admin with log on capability but everything defaults to the new hackers admin with the name AndriyOnz listed on my site. Under this new admin there is no delete button and I cannot figure out how to get rid of this without deleting my entire website. Can anyone help. I have blocked other from adding as users but am stuck with they unwanted admin. Also, there is a series of posts in polish by this hacker. I have coped them and they don't make sense and sound a bit technical regarding water storage etc.
Thank you for your help

Bolder Elements on "Private Plugin Auto Updates"

$
0
0

I am so close to finishing up the ability to auto-update my personal (non-repository) plugins, but getting it to work on a network install is a nightmare. I have no other way to include the files for the update than from my plugin's primary file, but this file does not load whatsoever from the network admin because it is not network enabled, only individually per site. This means that the information is never properly loaded into the network plugins page, and if I visit this page, it throws a wp_error and ditches the upgrade information.

Is this an impossible task?

jyd44 on "zxcvbn localization"

$
0
0

I would like to localize the zxcvbn script used for password strength evaluation. I have 99% percent of the data available in my language (french), but I have one question about the zxcvbn script distributed with WP. Looking at the dictionnaries, they look like obfuscated, while in the "offical" version of the script available on https://github.com/dropbox/zxcvbn they are not. This obfuscation is not so difficult to decode but brings a little bit more complexity to break the evaluation.
Is there a way to have an access to the modifications made to the original zxcvbn script to include it.

amitgupta007 on "woocommerce and pay pal"

$
0
0

hello
i using paypal for woo-commerce i give a right api but when check out with paypal then error displayed 10002 - You do not have permissions to make this API call.
please suggest me solution

gmirk83 on "Count users deleted"

$
0
0

Hi,
it is possible to count the number of Unsubscribe User?
What query can I use?
Thanks

BellaBerlin on "Save a full second on cron execution"

$
0
0

I found a problem with the cron mechanism and fixed it, saving 1 second per cron execution:

Wordpress' internal cron mechanism relies on users accessing the page which internally triggers a new http request to cron.php. To avoid slowing down the user's request, the cron request times out after 0.01 seconds (10 milliseconds) while the cron.php execution continues running in the background until it is finished. So far so good.

However, the http request defaults to the cURL library (if installed) which is not capable of handling fractions of a second for timeouts until version 7.15.5. Therefore, the class WP_Http_Curl adjusts the fractional timeout to one full second (even if cURL would support it).

class-http.php:1318:

/*
* CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since.
* a value of 0 will allow an unlimited timeout.
*/
$timeout = (int) ceil( $r['timeout'] );

As a result, every cron execution is slowing down the user for at least 1 second. For sites with a lot of cron activity (like mine where Rankie checks a keyword rank every 2 minutes) this is quite significant, and can be actually measured pretty precisely.

Luckily, WordPress also supports the stream transport library, which has no such limitations, so I decided to use it in favor of cURL for all requests that are non-blocking or have a fractional timeout. Here is my fix:

class-http.php:303:

// cURL cannot do real non-blocking calls, and the fractional timeout values are only
// supported since cURL 7.15.5 but are not supported in WP_Http_Curl. So if one of these
// conditions are met, we rather use PHP Streams to not delay the execution here (e.g. by cron).
if ($args['blocking'] == false || ceil($args['timeout']) != $args['timeout']) {
  $available_transports = array( 'streams' );
} else {
  $available_transports = array( 'curl', 'streams' );
}

class-http.php:323:

$request_order = apply_filters( 'http_api_transports', $available_transports, $args, $url );

Maybe this should be solved differently in the core at some point, but for now this is my fix, which works good for me. Thought I share it with you guys... ;-)

Regards,
Bella

Agence Myso on "`get_posts` by months?"

$
0
0

Hi everyone,

I'm getting mad... I am using wp_get_archives_cpt to display a list of custom post types by month. I would like the corresponding posts to show on the same archive page.
But I can't figure out how to display the posts corresponding to each month... I don't see any way to query posts by month ??!
Please help me !
Thank you all.


zielonyogr on "Author posts only bottom of post"

$
0
0

hello. How can i this something like this:

Author posts only bottom of post on main page in twentytwelve child themes. It can't be visible in each full post, here I used plugin to display bio about author.

How can i do this ?

Trinity7 on "Highlight Misspelled Words In Editor W YELLOW"

$
0
0

That little red line for highlighting misspelled words in WP editor is lame. I want my misspelled words to POP so I can find them at 3AM when I am tired and easily miss that lame little red line.

Where do I make the necessary edits to convert that lame little red line to YELLOW in WP theme 2014?

Many thanks.
JD

j.etter on "Custom Search Page"

$
0
0

Hello,

I'm trying to build a custom WP search page outside of a theme to integrate into my website. I'm having difficulty displaying the search results (on the same page as the search page). Here's my code:

<div>
    <form role="search" action="" method="get" id="searchform">
    <input type="text" name="s" placeholder="Search Blog Posts"/>
    <input type="submit" alt="Search" value="Search" />
  </form>
 </div>

<?php echo get_search_query(); ?>

<?php
echo $_GET['s'];
$args = array( 'posts_per_page' => 5, 'post_title' => $_GET['s'] );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    the_title();
    the_content();
endwhile;
?>

Right now this displays all posts on my blog (regardless of if the title is $_GET['s']. My followup question is how can I make it search for a keyword within the post title or post content rather than for the exact post title as I have now.

Thank you so much!

silver89 on "Remove trailing slash from new page created using add_rewrite_rule"

$
0
0

So I've created a WordPress plugin that allows me to make new dynamic pages from an external table in my database.

I have add a new template file called research.php, this page displays a single post that's not written in WordPress (external) and you reach it via the following URL: http://pssru.local/research/some-random-href

The problem is that the above URL 301 redirects to (a trailing forward slash has been added): http://pssru.local/research/some-random-href/

I've tried changing the permalinks to custom but as it's not a common setting, category base or tag base it has no effect and the trailing slash is still added.

Even the add_rewrite_rule() I've created doesn't have a trailing slash so what is force adding this trailing slash? Here is the core of my plugin routing:

function custom_rewrite_rule() {

    global $wp;

    add_rewrite_rule('research/(.+)$', 'index.php?pub_type=research&pub_href=$matches[1]','top');

    flush_rewrite_rules();
}

add_action('init', 'custom_rewrite_rule');

add_filter('query_vars', 'handle_custompage_query_vars');

function handle_custompage_query_vars($query_vars)
{
    $query_vars[] = 'pub_type';
    $query_vars[] = 'pub_href';
    return $query_vars;
}

add_filter('template_include', 'my_template', 1, 1);

function my_template($template){

    global $wp_query;

    if (isset($wp_query->query_vars['pub_type'])) {
        return $_SERVER["DOCUMENT_ROOT"].'/wp-content/themes/pssru/research.php';
    }
    return $template;
}

wally10 on "Wordpress is automatically re-directing /login to /wp-login.php"

$
0
0

Hello. I have a website that allows users to log in using the URL example.com/login

I now have 2 systems and want wordpress to continue using /wp-login.php and the other system to use /login

The problem now is that Wordpress is re-directing the /login to /wp-login.php

Any ideas guys?

Viewing all 8245 articles
Browse latest View live




Latest Images