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

lakshya2201 on "How do i remove "wp-" from all urls"

0
0

I want to remove "wp-" from wp-admin.php, wp-signup.php and etc. like edublogs and wordpres.com do.
my website is http://www.lemmeshout.com which is powered by wordpress 4.1.1


Michael Zangl on "Support addition of bulk actions to the media page."

0
0

Currently, all media bulk actions cannot be changed but must instead be added by using JAvascript and some dirty tricks to intercept them on submission.

What is the current status of this? Is there someone working on this? If not, and if it is desired/has the chance to get into wordpress, I would change in core and create a patch that adds support for custom actions (and makes the current ones a bit nicer, so that they e.g. also work in grid mode).

File affected:
/wp-admin/upload.php (search for the "bulk actions"-Comment).
/wp-admin/includes/class-wp-media-list-table.php (get_bulk_actions())

(Relatively useless) filter to delete existing actions:
http://codex.wordpress.org/Plugin_API/Filter_Reference/bulk_actions

Most helpful bug report I found:
http://codex.wordpress.org/Plugin_API/Filter_Reference/bulk_actions

HAcks to get it working in the current version:
http://wordpress.stackexchange.com/questions/91874/how-to-make-custom-bulk-actions-work-on-the-media-upload-page

RiaanPie on "wp_insert_post_data won't update meta and shows white screen"

0
0

Hello

I am trying to update a custom field with some data that I collect in the CFDB plugin. I can see all my data correctly if I use die() before the actual update_post_meta call. Here's my code:

add_filter( 'wp_insert_post_data' , 'modify_post_title' , '99', 2 );

function modify_post_title( $data , $postarr )
{
  if($data['post_type'] == 'pets') {
  	// Get all the email addresses associated with this pet that has sponsored
  	$graciousSponsors = do_shortcode('[cfdb-value form="Untitled" show="Extra2" filter="PetName='.$data['post_title'].'"]');
  	//die ($graciousSponsors." , ".$postarr['ID']." , ".join(", ",explode(", ", $graciousSponsors)));
    // Now set the custom field's value to the list of email addresses
    update_post_meta ($postarr['ID'], 'sponsor_emails', join(", ",explode(", ", $graciousSponsors)), false);
  }
  return $data;
}

the die() call shows me all of my information correctly. ANy help would be appreciated. :)

sunflyer on "user settings"

0
0

I'm making a plugin for wordpress, but how can I add a menu that each user can change ?

How it works is that people can add their links with a banner and description, but I want them to be able to change the description and the banner link later.

I managed to make the admin settings page, but not sure how to make the user setting page.

Please Add Screenshots on "Display something on an author's archive page if they are logged in"

0
0

Display "something" on an author's archive page if they are logged in.

Let's say i'm author A and i'm logged in. Author B is also online doing his own thang.

Can I go to author B's archive page and see "something" that will tell me author B is currently logged in and doing his own thang?

something like....
<?php if (author_is_logged_in() ) { ?>
<p>this author you are looking at is online!</p>
<?php }?>

missdixie on "Hour in comments"

0
0

Hi !
I Just bought a theme and I have a little problem with it.
In the comments, the hour doesn't appear. It's important for my nvisitors to know when the comments were posted. The developper of the theme doesn't want to work on this...
Any ideas? Thanks for your help and sorry for my English ;)

aiiiiiight on "Smooth scrolling using jquery/plugins"

0
0

Hi all, so I'm having some trouble getting some to work on this website that has a custom theme (I'm trying to get it to work with the black and white menu at the top):

http://etal.info/

At first I just tried to do it using the plugin "Scroll to Page ID" but that hasn't been working either. So I've been trying to program something myself. (Note: I really don't know anything about Jquery and have been mainly copying and pasting from github, developers' websites, etc.).

I think there may be some kind of script conflict, because I've tried to install smooth scrolling using a couple of non-plugin methods, and remnants of that may be laying around. For example, I tried to put this script in header.php, registering it in functions.php:
http://callmenick.com/2013/04/22/single-page-site-with-smooth-scrolling-highlighted-link-and-fixed-navigation/

I went into a whole rigamarole with jQuery, registering and enqueueing some non-plugin scripts because the site doesn't appear to be loading anything jQuery or Javascript-related at all. Something, I believe, should be appearing in the console when I click on my header links, but there isn't even a sign of failure. It seems things should be much simpler than this. Help?

PS: I've taken the steps in this thread to no avail:
Here.

noise on "prev/next post links only in same Sub-category"

0
0

Greetings!

I'm trying to make the "next post" & "prev post" links only link to posts in the same sub-category as the displayed post. (which seems like a pretty normal use case to me).

I've searched the web all day, and so far the only thing I've found is about a ka-jillion requests for this feature but no plug-in or hacks.

Anyone know of a solution ? Surprised that there isn't a plugin for this already, as it seems like a normal thing to do.


techie.girl on "Issue with Contact Forms 7 and jQuery"

0
0

I'm trying to get a form section to appear if "Yes" is selected in a dropdown box. I modified a code snippet that works on a checkbox. I have it working, sortof. For some reason, when the dropdown is opened, no matter which option is selected, it switches to yes, and can't be changed again.

The code for this part of the form starts after Zip at the div:

Zip*
[text* zip 5/5 class:zip]

Private Insurance?*
[select menu-ins id:privateins "Select""Yes" "No"]
<div id="insform"><h2 class="orange">Insurance Information</h2>
Please enter your insurance information into our secure form. Our intake specialist can verify your benefits and make sure you receive all the benefits you are entitled to.
Insurance Company*
[text* insco]
ID#*
[text* insid]
Group#*
[text* insgroup]
Last 4 digits of SSN*
[text* last4]</div>

<p align="center">
[submit "Get Help Now"]

<div class="red">* required field</div></p>

My jQuery is:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type='text/javascript'>
$(document).ready(function(){
$("#insform").hide();
$('#privateins').change(function(){
if($(this).val("Yes")) {
$('#insform').show();
} else {
$('#insform').hide();
}
});
});
</script>

I have it set in the template header. It does effect the form, because the section is hidden to start, its just making the dropdown do weird things. The link for the page is:

the addiction help hotline .com /get-help-now-3/ Sorry for doing the link this way, but I'm subcontracting part of this and would rather not have the link indexed. Thanks for all your help in advance!

beda69 on "save options sections one by one"

0
0

Hello

Hope I'm in the right area here.

I am coding a theme options page

after setting up some options (in array) for different theme options user can modify, I also added the proper validation and form to render those options

Thats all perfectly working

I the used this to save my options:

//the relevant "save" section of my code
case "close":
$i++;
?>
<input name="save<?php echo $i; ?>" type="hidden" />
    <?php submit_button() ?>//that button displays after each section
</div><!--#section_body-->
</div><!--#section_wrap-->

<?php break;
}
}
?>

<input type="hidden" name="action" value="save" />
<?php submit_button( 'Save All Options' ) ?>//after ALL sections
</form>

<form method="post">

<input type="hidden" name="action" value="reset" />
    <div class="warning">
    <?php echo _e('Warning! Next Step Resets ALL options!', 'minmax3'); ?>//After ALL sections
    </div>
<?php submit_button( 'Reset All Options' ); ?>
</form>
<br/>
</div><!--#options-wrap-->

OK, now, I would like my "Save Button" to save only a section at once
=> let's say section A has a button and section B too
If i now hit on save (doesn't matter which one) ALL sections get saved

thats cool for the last button that says "Save ALL Options"
But not for the button after each section that says "Save Changes" (default WP value)

So now, do we have any API to follow here?
I couldn't find any in this case.

could anyone give me a example?

:)

=> you know what would be very fancy?
the relevant section being shortly highlighted
(in whatever color)
once user saves one single section)
:) :)

I thank everybody who gives me a input here!
( i assume I must pass another variable in the save button, something like a "if" is section, save related section...) ??

focus97 on "Extend Wordpress (4.x) session and nonce"

0
0

Disclaimer - I posted this on StackExchange but also want to post here, as I'd love some insight.

We've got a small web application that allows users to log in (via WordPress) and remain logged in for a max 15 min session for security purposes. Because most sessions will last longer, I have a small ajax call that's made on each click of the html document itself.

The ajax call itself fires to the /admin-ajax.php file, and it hits a function (in functions.php). Below is that function:


function extend_my_session_yo(){
$user_id = get_current_user_id();
wp_set_auth_cookie($user_id, false, true);

$new_logout = wp_logout_url();

if ( is_user_logged_in() ) {
echo 'session extended 15 mins ' . $new_logout;
}
// if a user is *not* logged in, Wordpress just outputs a "0".
die();
}

The wp_set_auth_cookie() does the hard work. It correctly allows for (on each click) an extended 15 mins session. The problem is if someone tries to logout. The current logout link is echo'd via wp_logout_url(), but that logout url has a nonce from the moment it's created by WordPress.

So in the function above, I'm generating a new logout url (and from the WP core code it seems that this is generated by getting the session token from the new cookie), but each click of the new logout url gives the Wordpress Failure Notice page indicating a nonce mismatch. I've even gone so far to copy code from pluggable.php (for wp_verify_nonce()) for checking the hash_equals() function for $expected vs $nonce and they're equal. Yet I still get nonce errors.

Does anyone know how to set a new auth/logged_in cookie while also setting a new nonce to avoid these errors?

hanspralon on "Result limited to 10 items"

0
0

We have a website that developed by third party vendor some times ago. Now we find out there is one features (Post Category) that could only show 10 lines in our website, while at back office (admin panel), the items are more than 10. I need to show all items. Where do i start to fix this? tia.

sunrosea on "filtering edit-comments.php from text input"

0
0

Hi!

I've been trying really hard to make the edit-comments.php page display a filter to show comments by specific author only. I want this to be by input, and not a drop down list. Do any one have an idea of how I can make that happen?

Here's the code that works, but uses drop down list:

add_action('restrict_manage_comments', 'author_filter_2');

function author_filter_2() {

    $args = array('name' => 'user_id', 'show_option_all' => 'View all authors');
    if (isset($_GET['user_id'])) {
        $args['user_id'] = $_GET['user'];
    }
	wp_dropdown_users($args);
}

thanks for any help!

OrbiTorbi on "Filter video after upload via url"

0
0

Hello,

im looking for a filter that allow me to prevent the insert of videos in the editor. I found the "media_send_to_editor" filter, that filter works great for images but it doesn't work for url videos.

thanks in advance

ilfungo on "unable to create new administartors users"

0
0

Hi, trying to make a capability and role setup I install and used different plugins:
Capability Manager
Advanced Access Manager
Groups
Members
and finally I keep and I use Advanced Access Manager .
Noweverithing almost fine to go online but I have two problems: I would like to setup Shop Manager (woocommerce user) to create others Shop Managers, and I find out Administrator can't create other administrators. Any idea of what I should do to manage this situation?


vivoeusebio on "Click, load page, then do something depending on what was clicked"

0
0

Hi. I'm working on a child theme of Twenty Thirteen - http://mrem.byethost9.com/ - using Isotope (http://isotope.metafizzy.co/).
The website is for an illustrator and I'm using Isotope to filter through her works, that are displayed on the home page. I've got that part working with two menus that are filters - "ilustração" and "oficinas", each with their own sub-menus, that are also filters. This part is working.
When I go into another page, like "contactos", however, this complicates things. If I click the filters, I need first to return to the homepage and then filter the posts. I can only do the first part, like this:

//filterMenuItems contains the menu items that will filter the posts.
filterMenuItems.each( function (index) {
var itemLink = $(this).children("a");
itemLink.click( function() {
if (!isThisHome()) { //if we're not currently on the homepage, where filtering happens, then go to home page.
window.location.href = urlHome;
}
filterPosts(this); //function that does the filtering.
});

What I need is to check, each time the home page is loaded, if it came from a different page, and if so, what menu-item was clicked. If it was a filter menu item, then it needs to filter the posts. I'm guessing this is possible with some sort of event listener, but I'm not sure how to do that part. Can anyone give me a hint?

Thank you.

fredperes on "Filter content by taxonomy"

0
0

I'm developing a website with custom post fields (projects). The projects are organized by taxonomies (states). I need to create a drop down menu that the user selects which projects he would like to see, based on the state. But the challenge is: how to do this globally? When the user clicks in a internal page, the content remains filtered. Should I use cookies? How?

bananarama on "Date by season / quarter"

0
0

Instead of the normal date / time, I want to display the season in which a post was made. So for instance, march-may = spring (03-05).

I found this topic, but the plugin is no longer accessible.

I know it should be really simple to do, but I just can't hack it. I've tried:

<?php if ( '3' == date('n') ) : ?>
     <p>It's March</p>
<?php else: ?>
     <p>Not February</p>
<?php endif; ?>

Which detects the current month, rather than the post month. But when I try to combine with the post date it doesn't go:

<?php if ($post_date( '3' == date('n') ) ) : ?>
     <p>It's March</p>
<?php else: ?>
     <p>Not February</p>
<?php endif; ?>

herka on "Custom post type and page with same name mixup"

0
0

Anyone maybe knows how to avoid problem if you have a custom post type with slug 'medical-treatments' and then i create a default page named 'medical-treatments' in pages and then the problem with the regular page showing up appears ... any way to sort this out?

so
http://example.com/medical-treatments/some-treatment-category/single_treatment works - triggers single-medical-treatments.php
http://example.com/medical-treatments doesnt work - aka triggers index.php every time and not page.php

p.s. i can't change the slug and i can't change the page name - the urls needs to be like that ...

WoutCompay on "Advanced Custom Fields value in WP_Query"

0
0

I would like to display posts from a certain category on the homepage based on which category is selected by the user in an Advanced custom field select.

I now have the below working code, which shows posts from category 'Lisbon', but I would like to replace 'new WP_Query( 'category_name=lisbon' )' by something like 'new WP_Query( 'category_name=[specific advanced custom field value]' )'

How would I go about doing this? Thanks very much in advance!


<?php
// the query
$the_query = new WP_Query( 'category_name=lisbon' ); ?>

<?php if ( $the_query->have_posts() ) : ?>

<!-- pagination here -->

<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

<h1><?php the_title(); ?></h1>

<?php endwhile; ?>
<!-- end of the loop -->

<!-- pagination here -->

<?php wp_reset_postdata(); ?>

<?php else : ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>

Viewing all 8245 articles
Browse latest View live




Latest Images