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

ruthcatrin on "making links no-follow except once....."

$
0
0

Here's my page: http://www.scaryyankeechick.com/

If you scroll down a little, on the right hand side, is a "Non-Blog Links" section. I was contacted by one of those companies. Apparently because that set of links shows up on every single page of the blog it was screwing with their search engine rating. Did a temp fix by adding a plugin (called NoFollow Links) that allows me to select certain links and make them "nofollow". Fixed the problem. But I'd like to make them "follow-able" on the front page. So that the ones in all the archive pages are "nofollow" but only the front page link is "good". And I'm not sure how to go about that......I did a quick search but nothing popped up. If I missed another post that has the fix please point me to it!


oleggen on "basic authentication help wanted"

$
0
0

I'm trying to connect via basic auth using this script:

<?php
$username = "name";
$password = "pass";

$args = array(
    'headers' => array(
        'Authorization' => 'Basic ' . base64_encode( $username . ':' . $password ),
    ),
);
echo '<pre>';
echo http_get ( 'http://site.com/dev/wp/wp-json/users/me', $args );
echo '</pre>';
?>

The response I get is this:

HTTP/1.1 401 Unauthorized
Date: Mon, 25 May 2015 18:24:51 GMT
Server: Apache/2.2.24 (Unix) mod_hive/5.0 mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6
X-Powered-By: PHP/5.4.33
X-Pingback: http://www.betypist.com/dev/wp/xmlrpc.php
X-Content-Type-Options: nosniff
Host-Header: 192fc2e7e50945beb8231a492d6a8024
Transfer-Encoding: chunked
Content-Type: application/json; charset=UTF-8

4c
[{"code":"json_not_logged_in","message":"You are not currently logged in."}]
0

Any ideas on why?

Number_6 on "Changing tag"

$
0
0

Hi,
I'm using a theme called Floki and in the header it has:
<title><?php if (is_home () ) bloginfo('name'); else wp_title( '|', true, 'right'); ?></title>

On the homepage this outputs: "Eclectic Vibrations Radio" (the blog name)
An example of another page: "Dan Gilroy | People |"

After the separator I'd imagine the name of the blog should ordinarily follow. Think it's something to do with my installation (which is 1.5 years old) being messed up.

How could I manually insert the name within that "else"?

Cheers

Morgan Kay on "Can't trigger an AJAX function with a submit button in the dashboard?"

$
0
0

I'm writing a WordPress plugin. My plugin has forms that post data to other pages generated by my plugin within the WordPress dashboard. I am trying to create an AJAX function that is triggered when the form is submitted. My AJAX is working just fine - just to test it, I triggered the event when I click on my plugin header, and it works perfectly fine there. However, if I try to trigger the event when I click a submit button (any input type="submit"), it doesn't work. The JavaScript runs just fine, but it can't find the PHP function to run.

Here is my JavaScript:

$('.button').on('click', function (e) {
    var url = testingajax.ajaxurl;

    var data = {
        'action': 'testing_ajax_wtf',
    }

    $.post(url, data, function (response) {
        console.log(response);
    });
});

The PHP function just returns a string (for testing purposes).

This works just fine if I change the first line to:

$('.my-plugin-header').on('click', function (e) {

But if I try to trigger it when a submit button is clicked, or when a form is submitted, the JavaScript runs, but it cannot find the PHP function.

Any idea what is going on here? Does WordPress somehow stop you from running AJAX when you submit forms in the dashboard?

(Also, FYI, I posted this question here as well: http://wordpress.stackexchange.com/questions/189241/cant-trigger-an-ajax-function-with-a-submit-button-in-the-dashboard/189244?noredirect=1#comment275919_189244 At first I thought that adding $('#your_form_id').submit(); was a reasonable workaround, but then I realized that submit() doesn't actually send the value of the submit button, and that value is vital to what I am doing (some forms have a yes button and a no button)).

So is there a way I can run an AJAX function when clicking a submit button in the dashboard?

Aaron on "Custom Bullet Points: One Bullet Not Aligned"

$
0
0

I made custom bullet points (music notes) for my sidebar menu.

Do you know why the first custom bullet on a set of bullets would be off to the right side? I know that sounds really weird, but that's what is happening to me right now in my sidebar: CustomRoyaltyFreeMusic.com

I would really appreciate any help!

Thanks again.

v1rtual1st on "DOMPDF doesn't work"

$
0
0

I cannot get DOMPDF to generate PDF.

I have put DOMPDF files into 'themedir/dompdf/'

require_once(echo get_template_directory_uri()."/dompdf/dompdf_config.inc.php");

$html =
  '<html><body>'.
  '<p>Put your html here, or generate it with your favourite '.
  'templating system.</p>'.
  '</body></html>';

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");

Any ideas? Thanks

Pia on "Display Unit Price & Case Unit in checkout page / CSS"

$
0
0

Hi.

Two questions pls...

(1) Anybody please help me to display the unit price (5th column) and the case unit (2nd column) of every item in our checkout page, more like an invoice page. We sell all our products in cases.

I used this

<td class="unit-price">
<?php
global $product;
if ( $price_html = $product->get_price_html() ) :
   echo $price_html;
endif;
?>
</td>

But it didnt work with my custom order-details.php

Any solution pls? I've been stucked here for days.

pls view

(2) Moreover, if I may ask, anybody has an idea how can i change the font size of the "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won’t be shipped until the funds have cleared in our account. – SAMPLE ONLY"........
I would want to change it into font-size: 10pt; but i couldnt do it without class because it has <p>. And it affects everything.

I am a newbie here. Please help. Thank you so much.

-Pia

dexterny on "How show post in table on page?"


ansley.kodework on "Custom taxomony query returns all results"

$
0
0

I am trying to query custom posts based on custom taxonomy. i have used tax query in my WP_Query please find my query below

$argsu = array(
	'post_type' => 'product',
	'tax_query' => array(
		array(
			'taxonomy' => 'product_cat',
			'field'    => 'slug',
			'terms'    => 'helse',
		),
	),
);
$query = new WP_Query( $argsu );

when i print $query the query thats printed is the following..

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (11,14,15,16,17,43,44) ) AND wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10

I am not able to figure out as to why all the taxonomy ids are getting called when i have specified just one? Seems like its not taking my tax_query

benpines on "A user variable whose versions are also saved."

$
0
0

I have a diet site. I want to add a variable to wordpress called "weight", so users can fill their weight.

My question is - How can all past versions of "weight" that people fill also be saved? I want to create a timeline for all the weights they filled.

In what WP database should I create this object?

guymizrahi on "wpdb create categories"

$
0
0

hello everyone,
i've got one dashboard,
from there i connect to all my websites.

$mydb = new wpdb( $dbuser , $dbpassword , $dbname , $dbhost );

when i connected,
i wanted to know if its possible create new categories and posts?
i tried to use:

wp_insert_term($cat_name, 'category', array(
'slug'=>sanitize_title($slug_cat_name),
));

the problem is..
its create new category.. but in my one dashboard website and not in the website i just connected.

how i make $mydb create categories, posts etc

thanks in advance,

maxuldahl on "Website size optimization for mobile devices"

$
0
0

Hey everybody, I hope you can help me.

I am aware that there are apps that make it possible for you to make custom mobile versions of your webpage. What I want though, is only to display the webpage like it is, but in the right size on the mobile display. (www.walkingforwater.dk)

When loading the webpage on my android, I only see the corner of the page. Is it possible to change that with a code snippet, so that the whole width of the page is being displayed.

Thanks! And have a great day

-Max

tattooman on "Display information from Custom Plugin Taxonomy"

$
0
0

I have inherited a site that has a custom plugin with taxonomies. The client has made two requests. 1) Display the most recent (newest) posts and 2) display a "featured" post image that links to the post.

For the featured post, I was thinking a of a Featured meta box. If the box is checked "yes", the featured image would display and link to the post.

Do you have recommendations to point me in the right direction for the requests?

Thanks

desi_terz on "Unkown text format - Footer section"

$
0
0

Hi. Few days ago I logged in my admin page and I noticed that a plugin that I had installed - its homepage - displayed even in post admin page. So I deleted by using ftp. Then I noticed the footer section of the website as you can see here: wwww.kinesis-gym.gr
I also found an "extra" admin, I deleted the user and change pass etc. I dont understand if this is a problem link to the plugin, or css issue.
Any ideas?

hagcel on "Different homepages based on cookies?"

$
0
0

Hey guys,

I'm wondering how to serve a different homepage to a visitor depending on the existence of a cookie.

I presently have a wordpress instance that serves as a marketing site for a SAAS product. We have a link in our header for login that takes users to the sign-in page for our app, which is totally separate from wordpress.

I'd like our "keep me logged in" cookie to cause wordpress to take them to a custom page that focuses on the login process and some advocacy initiatives we have.

I tried searching, but wasn't coming up with anything. Thanks for all the help so far, been lurking for years now, and I always find answers without having to ask questions.


ameraz on "Attachment Filter not displaying correctly in Media Uploader"

$
0
0

I'm working on a plugin that uses the Media Uploader.
Everything's working fine except for one little thing.
When rendering the Media Uploader Modal box, it shrinks the Media Attachment Date Filter selector and thus not displaying it correctly: http://ibin.co/235ba47YuGJP
(looks like an error to me with a random 'A', although the filter does work, the 'A' is for 'All dates')

I assume that I could just probably style the selector through my plugins custom admin CSS, but I'm guessing that it should work fine without any need of styling (?).

The code I'm using to display the frame is:

file_frame = wp.media.frames.file_frame = wp.media({
	title: "Set Banner Image",
	button: { text: "Set Banner Image" },
	multiple: false,
	library: { type: 'image' }
});

Hank on "Need Help Removing Malicious Link Not in Header.php"

$
0
0

Hi there!

A friend of mine's site is going through something very very odd. Someone has entered a malicious link and text and I can't seem to remove it. I've inspected the element in Chrome and am really lost...

http://cashforcarssarasota.com (Warning...there's foul language!)

I've looked through the css and header.php files with no luck. My only guess is that there's some javascript code that was put there somehow. I'm really desperate to figure out something, anything that will point me in the right direction!

dartiss on "Issues with submenus"

$
0
0

I'm writing a plugin relating to videos. As part of this, I've introduced a new admin menu option and, under that, two options to allow you to list video profiles and edit them. Echoing the standard approach to posts and pages, there are two sub-menu options - "All Profiles" (from where you can list and edit profiles) and "Add new profile" (which takes you straight to the option to create a new profile).

Now, for the first submenu option I'm using a single PHP file for both the profile listing and editing - this ensures the correct submenu option remains highlighted (previously the add/edit option was it's own, separate file meaning that when you edited a profile from the profile list screen it would then highlight the "Add new profile" submenu).

Now the submenu highlighting works correctly, I have another issue - the profile list screen has a Screen Options and Help tab. However, it also appears in the editor as well, as they share the same file name. Is there a way around this? Can I switch between different tabs within the same file?

Any help will be appreciated.
David.

tsusanka on "Replace administration search with my own"

$
0
0

On my website I have my own search implementation (using elasticsearch) and I use WP for administration only. In admin, in Posts section there is a search bar in the top right corner. I would like it to use my implementation of search rather than the default one.

I know there is a pre_get_posts action, however that is used to alter the search query. I would like to completely avoid that and call my own implementation, which returns a simple array of posts and pass it then as a search result.

Can this be done? The alternative is to remove the search bar completely and replace with my own. However, I didn't succeed in that either.

authorleon on "Post Count for Categories, however not to calculate a total"

$
0
0

Normally this is how the category widget works.

Fruits (15)
- Apples (7)
- Oranges (3)
- Grapes (5)
Apples, Oranges and Grapes contains posts, however nothing in Fruits.

Lets assume that Fruits has 10 posts.

It would look like this.

Fruits (25)
- Apples (7)
- Oranges (3)
- Grapes (5)
However, I would like it to look like this:

Fruits (10)
- Apples (7)
- Oranges (3)
- Grapes (5)
The main category Fruits does NOT count up all the sub-category posts, rather its own posts.

Viewing all 8245 articles
Browse latest View live




Latest Images