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

Viamultimedia on "Problem selected sidebar option for posts"

$
0
0

Hello

Well i propose a select option meta box sidebar. All sidebar apears correctly in the select options but if i go to a post and i choose a sidebar it don't save the sidebar selected for the post.

An idea please ?

public function bakerineMetaOptions() {
		global $post;
		if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id;
		$custom = get_post_custom($post->ID);
		$sidebar = $custom["sidebar"][0];
		$options = $GLOBALS['wp_registered_sidebars'];
		$selected = '"selected"';
	?>
    <select name="sidebar">
    <?php foreach ( $options as $sidebar ) : ?>
	    <option value="<?php echo $sidebar; ?>"<?php echo $selected; ?>><?php echo $sidebar['name']; ?></option>
    <?php endforeach; ?>
    </select>
    <?php
	}

Kittyridge on "Custom featured image size on first post only"

$
0
0

Can anyone provide a function to specify the featured image size for the first (most recent) post only? The featured image size needs to be untouched for all the other posts. Only the first post in the loop on page 1 needs a special featured image size. Below was my very lame attempt at it, which not surprisingly did not work:

if (have_posts() and has_post_thumbnail()) :
$post = $posts[0]; $c=0;
while (have_posts()) : the_post();
$c++;
if( !$paged && $c == 1) :
the_post_thumbnail('full');
endif;
endwhile;
php endif;

Any help appreciated as this is obviously over my head.

onogbebor on "Login form not working"

$
0
0

Hello Community,

I followed some tutorials about creating a php login form and I not getting the login to work properly. I' m using wordpress 3.9, a Revera Child theme and have the template properly installed in MySQL database. I have an init.php, connection.php, login.php and all other necessary functions that I know of but can't seem to get the login.php to be called as the "action" portion of my form.

Please advise and thanks in advance.

Here is my code:

<form role="form" action="login.php" method="post">
     <div class="form-group">
	<label for="exampleInputEmail1">Email address</label>
		<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email" name="email">
      </div>

     <div class="form-group">
	<label for="exampleInputPassword1">Password</label>
	        <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password" name="password">
     </div>

      <a class="btn btn-merchants btn-lg" href="http://flavorping.com/sign-up/">Not a member? Join Us</a>

      <button type="submit" class="btn btn-primary">Log In</button>
</form>

The Bean on "Modern Tribe The Events Calendar"

$
0
0

After a LONG period of procrastination, I decided to upgrade to the current release of The Events Calendar (Modern Tribe.) I am WAY, behind but it looks great and is working so I wasn't too worried.

I struggled a couple times in the past to upgrade but surrendered.

My issue is with the font size of the heading and the links within the calendar (they're WAY too large.) Also the headings are now Monday (vs Mon), Tuesday (vs Tue), etc.

I just spent half a day trying to get this resolved (trying to edit various css files) to no avail. I suspect I made css changes in the past to get the font size I wanted but I'm unable to re-create that change.

I found many discussions/solutions, tried each of the fixes but have failed miserably.

Can someone point me to the .css file that needs to be changed and where the change is to be made?

This looks just the way I want it (old, old, old release of TEC) http://www.npscolorado.com/events/month/ and I want to keep the font size looking this way.

Many thanks in advance.

photocurio on "storing a plugin option as an array"

$
0
0

I am writing a plugin, and I have an options page for it. The options page has a textarea input.

I'd like the input from the textarea to be stored as an array, with each line as a separate value (a string of text). How do I do that?

Also, do I need to sanitize this input, or does WordPress do that?

Saeed Salam on "How to display an ad after a number of post in homepage?"

$
0
0

Hello,

I have been searching for a way to display ads in my homepage. my homepage have 20 posts. and i want to show an ad just after 10th post. i got a code to add ads after every 10th post, but i only want to show an ad after the 10th post. don't want to repeat it.

can someone help me on this?

thanks
Saeed

ivendo on "bulk update all records of a certain posttype automaticaly with php"

$
0
0

How can I save all records of a particular posttype in bulk with php code. I would like to save daily (automated) all records (without changes). With updating a post a particular function is already implemented. However, we now need to manually update the posts. How can this be done ? (daily automated) How does such a bulk update code in php look like?

Rustaurius on "Modify Title Within Shortcode Function"

$
0
0

Hi,

I'm looking to potentially modify the page title within a shortcode, depending on a saved setting. I can't get my head around what I should be calling. Here's what I've tried so far:

if ($Filter_Title == "Yes") {
  add_filter('the_title', 'Alter_Title', 20, $ProductName);
}

Those lines are within a shortcode that is working normally. The code doesn't seem to work, so any thoughts on where/how I should be adding the call to the filtering function would be appreciated!


hugolaporte on "AJAX Requests in plugins since wp 3.9"

$
0
0

Since 3.9, in wp-admin/admin-ajax.php there's an element (autosave) missing in the $core_actions_post array.

This caused me to return 0 in all my AJAX Requests.

I backed up an old version (3.8.4) of the admin-ajax.php file and everything works fine now. Just saying.

wkinne on "active nav items"

$
0
0

I am having an issue with my active nav items. home is staying active when on the Leasing and Sales page. You can take a look here, http://previewyournewwebsite.info/walker/. Does anyone know what might be causing this and if there is a workaround?

ATimberlake on "Profile Editor Not Working"

$
0
0

Hi All, hoping you can help me with this. On my wordpress site, whenever I edit a users information and hit "update" it says it updated and will stay updated until the user logs out. But when they come back the user's profile fields are empty again? Any thoughts? Is it just not saving to the database correctly? I'm at a loss here. I replaced the user-edit.php file with an original file just to be sure but no luck.

hmckc_admin on "403 Forbidden error message when logging in"

$
0
0

I have not been able to log into my WordPress site since yesterday. I'm getting the following error message: You don't have permission to access /wp-login.php on this server.

Any advice? I haven't installed any plug ins recently (although I may have updated a few) and I haven't made any changes in the hosting package.

hollywoodtoday on "How to delete the hack code on my wp frontpage?"

$
0
0

How to delete the hack code on my wp frontpage?

I can see the code when I visit my page domain.com and right click and view source.

My question is, where is this page in my cpanel?

I can't find the code in wp editor, so I need to edit via cpanel.

I've somebodys dumb iphone injection across all my sites, like 40 sites. Im hoping its just a small piece of code on all my frontpages.

larryoscs on "Link to own's post on front end"

$
0
0

I've got a site built where everything is done on the front-end. With the exception of admins, no one will ever see the dashboard, ever. But I want a link that someone can click that will allow them to see their own posts in a list style. So, the link for each person would basically be "http://www.my-domain.com/author/(current logged in user)/" It's set up where they can edit their posts on the front end, but I can't figure out how to make the link work. It'll be going in the header and footer, so PHP is fine. It'll be written into an if statement, wherein if the user is logged in, then several lnks will show, including this one I'm trying to build. If not, then the login and register buttons show. Does any of this make sense? Thanks!

Bob Cristello on "Allowing Subscriber to edit other specific subscribers info"

$
0
0

I know this is probably a complicated question, but I would like to try and get an answer if it is possible.

My client wanted a site where users would have sub-users assigned to their accounts. The Admin and Editor roles were reserved for their employees. Right now, I have set up a system where a user may sign up and other users may sign up under them in a family type account.

I accomplished the relationship of the sub-user to the master-user by adding a field in the usermeta table that indicated the master-user UserId.

I would like the master-user to be able to edit their sub-users user information.

I would also like, if possible, to have the sub-users show up in the user admin menu and not just the current subscriber account.

I would also like to accomplish all of this in the theme function file or a plugin so that I do not touch any of the core WP code.

Any suggestions on where to start or what to do would be appreciated.

Bob


AlexisTwigg on "Posts been added to live with no knowledge to users"

$
0
0

My website aversionrms.co.uk seems to have been hacked.

Posts are been added to live without the knowledge of any of the users. I have changed the admin password but posts are still getting published (3 in the last 24 hours). These seem to be full articles on cheap/replica watches and fake bags etc.

The latest WP has been installed.
Admin password has been strengthened but the Admin keeps posting new posts.

I have used http://sitecheck.sucuri.net/ but isn't detecting any issues.

Any thoughts/help on what could be the issue?

Regards
Alexis

rdellconsulting on "wp-query multiple orderby keys"

$
0
0

I'm using pre_get_posts to successfully output a list of CPTs using order as primary key:

add_filter( 'pre_get_posts', 'my_get_posts' );

function my_get_posts( $query ) {

    if ( !is_admin() && $query->is_home() &&  $query->is_main_query() || is_feed() ) {
        $query->set('post_type', array( 'post', 'statsbox', 'imagebox', 'socialbox', 'quotebox', 'linkbox', 'videobox', 'textbox' ) );
        $query->set('orderby', 'meta_value_num');
        $query->set('meta_key', 'order');
        $query->set('order', 'ASC');
    }
}

I'm trying to add another meta_key client_name as primary sort key.

Novice, I've tried:

add_filter( 'pre_get_posts', 'my_get_posts' );

function my_get_posts( $query ) {

    if ( !is_admin() && $query->is_home() &&  $query->is_main_query() || is_feed() ) {
        $query->set('post_type', array( 'post', 'statsbox', 'imagebox', 'socialbox', 'quotebox', 'linkbox', 'videobox', 'textbox' ) );
        $query->set('orderby', 'meta_value meta_value_num');
        $query->set('meta_key', 'client_name order');
        $query->set('order', 'ASC ASC');
    }
}

Any help appreciated!

Free269 on "How do I add A Div around each WordPress post image ?"

$
0
0

I want to add a div around every image that is posted on my wordpress blog post. How can I do it?

(For the curious ones, I'm attempting to pop out some share buttons whenever a user hovers over an image).

This is an example of what I want to do:
http://jsfiddle.net/vzurqnvo/
It's more that wrapping it with a div, after the image there are other things.
My unanswered post on stackoverflow:
http://stackoverflow.com/questions/25403001/how-do-i-add-a-div-around-each-wordpress-post-image

Someone suggested me to add this to functions.php and it didn't work:

add_filter( 'image_send_to_editor', 'wp_image_wrap_init', 10, 8 );
    function wp_image_wrap_init( $html, $id, $caption, $title, $align, $url, $size, $alt ) {
    return '<div id="wp-image-wrap-'. $id .'" class="wp-image-wrap">'. $html .'</div>';
}

clever_name on "Responsive Full Screen Images in WonderPlugin Grid Gallery"

PrfctGdess on "Redirect Search Results to Home Page"

$
0
0

Good morning all!

I have a WP site where I would like to redirect a couple of URLs to the homepage. This was straightforward enough with the regular pages - I just put Redirect rules in the .htaccess file. However, I'm having trouble redirecting on a search term.

Any time someone searches for "specific term", I want it to redirect to the homepage instead of showing the search results (but just for that one term).

So in this example, the URL generated is http://www.mysite.tld/?s=specfic+term

I want that to automatically redirect to http://www.mysite.tld

Any ideas how to accomplish this? TIA!

Viewing all 8245 articles
Browse latest View live




Latest Images