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

YvonneTaylor on "CSS problems with WP plugin Responsive Flipbook"

$
0
0

Can someone help woth my css problems please, I have spent 2 weeks trying to get my first flipbook to work.
I understand that the theme has css coding and I need to over ride this to make it work in the flipbook as the text will not change size or style.
I have tried using the following

#content p.page-15{font-family:Times New Roman,Times,serif; font-size: 8px; line-height: 50%; } I put this in page css.

<p class="page-15">lots of text here...........</p> I put this in html page content.
When I preview the page it looks okay, but when uploaded it looks like the css in the theme has taken over again.

The url is http://www.thedogsclub.com/test/#17

Any help would be much appreciated as I as going round in circles here.
Many thanks


lastonestanding on "WooC Shipping Details Form"

$
0
0

I am requesting to learn how to change the name "Shipping" on the WooC Shipping Details Form during checkout? Instead of "Shipping" I want to call it something other than "Shipping" such as "Delivery". Any help would be appreciated. I am working with all the latest versions of WooC and Word Press and using a child theme so any changes to the page name would be preserved.

lastonestanding on "Contact Form 7"

$
0
0

The plugin gives the ability to create a contact form including a file upload field. I am using the newest version of the plugin and the newest WP as well. I want to add a file upload for image and another for audio file upload. I tested and the files are too large so the error response says it can't complete the upload. I changed the parameters to allow 10 meg upload files still no solution. How can I overcome this issue and successfully upload image and audio files up to ten meg each.

wotto on "Dropdown to select and change current theme"

$
0
0

Hello, so we are working on a hosting site for restaurants where they will have option between three different themes. We are doing this through a multisite so they will each have their own subdomain and can apply whichever theme out of the three that they would like, and that all works fine.

What we would like, however, is to have a demo site (also a subdomain, testsite.domain.com) where they can see the three different themes 'live', so essentially a dropdown in the header or sidebar to select one of the three themes and when they select a theme the page reloads but now with the selected theme applied to the demo site.

I know that the current theme is in the rows template and stylesheet in the wp_n_options where n is the sub site ID. Is there any other way to change the theme rather than a direct SQL UPDATE? is it even safe to do a direct SQL UPDATE to the live database? I know theme sites such as elegantthemes.com have a live demo that is very similar to what i am describing but of course i cant know anything about their specific implementation. Im really struggling on finding any references online about this type of thing and would really appreciate any hints or sources that will help me out.

murraymarmoset on "How to disable user email validation"

$
0
0

I need to allow users to share the same email address when registering. I know there are a few reasons this is bad idea but I need to do it for my specific site.

I tried the 'allow multiple accounts' but this does not work with the WP CRM plugin I am using so I would like to find a way to allow WP to allow the same email address to be used with multiple user accounts.

Is this possible? Thanks

everrrettt on "Class based on nav item title not working"

$
0
0

Hi,

I am coding a custom theme. I'd like to add a special class to the
<li> tags based on each's title but the $items variable/parameter for nav_menu_css_class returns empty (var_dump($items) returns NULL).

Hence 'title_' is all that's returned in the following function:

function filter_nav_item_css_attributes($classes, $item)
{
    if(is_array($classes)){
        $classes = array_intersect($classes, array('current-menu-item'));
        array_push($classes,'title_'.$item->title);
        return $classes;
    } else {
        return ' ';
    }
}

BRG Web on "WP_Query Taxonomy Parameters"

$
0
0

I am trying to query a custom post type but it is not working.

I am using Elegant Theme's Nexus with All in One Event Calendar.

The theme has a featured slider in the home page that gets the recent posts from a regular post category and displays it as slides. I want it to get the recent events from AIO Event Calendar, that are saved as a specific post type and display as slides.

The original code for the featured slider in the homepage is:

<?php
	$i = 1;

	$featured_args = array(
		'posts_per_page' => is_category() ? 2 : 4,
		'cat'            => (int) get_catId( ( is_category() ? get_query_var( 'cat' ) : et_get_option( 'nexus_feat_posts_cat' ) ) ),
	);

	if ( is_category() ) {
		$sticky_posts = get_option( 'sticky_posts' );

		if ( is_array( $sticky_posts ) ) {
			$featured_args['post__in'] = $sticky_posts;
		} else {
			$featured_args['orderby'] = 'rand';
		}
	}

	$featured_query = new WP_Query( apply_filters( 'et_featured_post_args', $featured_args ) );
?>

I changed the $featured_args like this:

<?php
	$i = 1;

	$featured_args = array(
		'posts_per_page' => is_category() ? 2 : 4,
		/*'cat'            => (int) get_catId( ( is_category() ? get_query_var( 'cat' ) : et_get_option( 'nexus_feat_posts_cat' ) ) ),*/
		'post_type' => 'AI1EC_POST_TYPE'
	);

	if ( is_category() ) {
		$sticky_posts = get_option( 'sticky_posts' );

		if ( is_array( $sticky_posts ) ) {
			$featured_args['post__in'] = $sticky_posts;
		} else {
			$featured_args['orderby'] = 'rand';
		}
	}

	$featured_query = new WP_Query($featured_args ) );
?>

But nothing is showing in the slider anymore.

What am I doing wrong?

The nexus theme: http://www.elegantthemes.com/demo/?theme=Nexus
All in One Event Calendar: http://wordpress.org/plugins/all-in-one-event-calendar/

The site that I am trying to do this: http://brgweb.com.br/ibmundial

Thanks!

raybeam on "Dynamic Table CUSTOM FIELD WP back & front end"

$
0
0

Hi,

I want to create a custom field in WordPress that will allow me to create a table with an undefined number of rows. The number of columns will always be five. Example:

<table>
	<tr>
		<th>Unit Name</th>
	  	<th>Number of Beds</th>
	  	<th>Size M²</th>
	  	<th>Price from</th>
	  	<th>Price to</th>
	</tr>
	<tr>
		<td>dynamic content</td>
		<td>dynamic content</td>
		<td>dynamic content</td>
		<td>dynamic content</td>
		<td>dynamic content</td>
	</tr>
</table>

The requirements are:

1) Must be able to add new rows dynamically in backend by clicking a "+" button.
2) Must be able to save data in rows
3) Must output to the front end in the proper styling.

I have created custom fields similar to this one, but they had fixed amounts of data. I know how to the basics but I don't know what to do to create these dynamic tables. My PHP is limited, I'm quite a newbie, but I understand blocks of code when I see them, just don't write them from scratch very well.

Here is the code I wrote to output one static table row.

<?php
/********************************************************************/
/* UNITS CUSTOM FIELDS */
/*********************************************************************/
add_action( 'admin_init', 'unit_type_admin' );

function unit_type_admin() {
	add_meta_box(
		'unit_type_meta_box',
		'Unit Type',
		'display_unit_type_meta_box',
		'post',
		'normal',
		'high'
	);
}

function display_unit_type_meta_box( $unit_type ) {
	$unit_name = esc_html( get_post_meta( $unit_type->ID, 'unit_name', true) );
	$num_beds = esc_html( get_post_meta( $unit_type->ID, 'num_beds', true) );
	$size = esc_html( get_post_meta( $unit_type->ID, 'size', true) );
	$price_from = esc_html( get_post_meta( $unit_type->ID, 'price_from', true) );
	$price_to = esc_html( get_post_meta( $unit_type->ID, 'price_to', true) );

	?>
		<label for="unit_name_text">Unit Name: </label>
		<input type="text" id="unit_name_text" name="unit_name_text" value="<?php echo $unit_name; ?>" /><br />

		<label for="num_beds_text">Number of Beds: </label>
		<input type="text" id="num_beds_text" name="num_beds_text" value="<?php echo $num_beds; ?>" /><br />

		<label for="size_text">Size M²: </label>
		<input type="text" id="size_text" name="size_text" value="<?php echo $size; ?>" /><br />

		<label for="price_from_text">Price From (THB): </label>
		<input type="text" id="price_from_text" name="price_from_text" value="<?php echo $price_from; ?>" /><br />

		<label for="price_to_text">Price To (THB): </label>
		<input type="text" id="price_to_text" name="price_to_text" value="<?php echo $price_to; ?>" /><br />

		<hr />

<?php

	}

add_action( 'save_post', 'unit_type_fields', 10, 2 );

function unit_type_fields( $unit_type_id, $unit_type) {
	if ( $unit_type->post_type == 'post') {
		if ( isset( $_POST['unit_name_text'] ) && $_POST['unit_name_text'] != '' ) {
			update_post_meta( $unit_type_id, 'unit_name', $_POST['unit_name_text'] );
		}
		if ( isset( $_POST['num_beds_text'] ) && $_POST['num_beds_text'] != '' ) {
			update_post_meta( $unit_type_id, 'num_beds', $_POST['num_beds_text'] );
		}
		if ( isset( $_POST['size_text'] ) && $_POST['size_text'] != '' ) {
			update_post_meta( $unit_type_id, 'size', $_POST['size_text'] );
		}
		if ( isset( $_POST['price_from_text'] ) && $_POST['price_from_text'] != '' ) {
			update_post_meta( $unit_type_id, 'price_from', $_POST['price_from_text'] );
		}
		if ( isset( $_POST['price_to_text'] ) && $_POST['price_to_text'] != '' ) {
			update_post_meta( $unit_type_id, 'price_to', $_POST['price_to_text'] );
		}
			}
}

function display_unit_type() {
	global $post;

	$unit_name = get_post_meta( $post->ID, 'unit_name', true );
	$num_beds = get_post_meta( $post->ID, 'num_beds', true );
	$size = get_post_meta( $post->ID, 'size', true );
	$price_from = get_post_meta( $post->ID, 'price_from', true );
	$price_to = get_post_meta( $post->ID, 'price_to', true );

	$allowed_html = array(
	'a' => array(
		'href' => array(),
		'title' => array()
		),
	'em' => array(),
	'strong' => array()
	);

	$_unit_name_output = wp_kses( $unit_name, $allowed_html );
	$_num_beds_output = wp_kses( $num_beds, $allowed_html );
	$_size_output = wp_kses( $size, $allowed_html );
	$_price_from_output = wp_kses( $price_from, $allowed_html );
	$_price_to_output = wp_kses( $price_to, $allowed_html );

		$output = '<div class="col-md-12">
					<div class="table-responsive">
						<table class="table table-bordered table-striped">
							<tr>
								<th>Unit Name</th>
							  	<th>Number of Beds</th>
							  	<th>Size M²</th>
							  	<th>Price from THB</th>
							  	<th>Price up to THB</th>
							</tr>
							<tr>
								<td>'.$_unit_name_output.'</td>
								<td>'.$_num_beds_output.'</td>
								<td>'.$_size_output.'</td>
								<td>'.$_price_from_output.'</td>
								<td>'.$_price_to_output.'</td>
							</tr>
						</table>
					</div>
				</div>';

		if($_unit_name_output != '') {
			return $output;
	}
}
add_shortcode( 'project-info-box', 'display_unit_type' );
?>

How could I add to or change this to allow dynamic rows. I am looking into arrays and I think that seems to hold some promise, but I don't know how to implement it.

Any help greatly appreciated!


hunterhogan on "Must plugins W3C validate like Core and Themes?"

$
0
0

The documentation is unclear to me.

WordPress Core must validate
"All HTML pages should be verified against the W3C validator..."

Theme Development Standards say themes must validate
"Use well-structured, error-free PHP and valid HTML. See WordPress Coding Standards."
Links to http://make.wordpress.org/core/handbook/coding-standards/ which links to link above.

But, I can't find a straight answer to the issue of pluging standards. The following is the best I can find.

  1. https://codex.wordpress.org/Developer_Documentation#Plugin_Development
  2. "WordPress Coding Standards - General information about coding standards for WordPress development" links to the defunct WordPress Coding Standards
  3. WordPress Coding Standards says "The WordPress HTML Coding Standards are now located in the Core Contributor Handbook." (emphasis added)
  4. Core Contributor Handbook links to the quote at the top of this post.

That seems to suggest that plugins, like themes and core, must W3C validate, but it does not use strong, clear language the way that the theme development page unambiguously adopts the core coding standards.

So what?
Why do I care? Because I currently build my website by hand, but I plan to expand it from approximately 800 pages to tens of thousands of pages. I need a CMS to do that. I need my CMS to be predictable. While I prefer that plugins adhere to a standard, what I care about most is knowing whether or not I can expect a plugin on the WordPress repository to adhere to a standard. If I can't expect it, then that is ok: I will just need to test plugins more thoroughly.

epiric on "Default Gallery fails HTML validation"

$
0
0

Hello. I tryed Googling around for my issue.. But i think i didnt manage to find exactly what im looking for. The thing is that i have few subpages with gallery (default wordpress that opens in Lightbox(but thats not issue) and when i went to w3c validation for html5 it failed. It gives me
"Element dl is missing a required instance of child element dd."
</dt></dl><dl class='gallery-item'>"

Im not using titles on my images, is that a problem? Because i dont need them. Is there any way to edit functions.php for gallery to stop echoing this? What will i loose if it stops,and will i have to redo all galleries again so it applies to them? I tryed removing that attribute in media.php but nothing happened.
Thank you

urbanrich on "How can you create anchor links in menu drop down?"

$
0
0

Hiya all

I'm trying to change menu links into anchor links. I have a page called 'Menu' that I would like to have a drop down list with links that jump to certain parts of the page i.e 'Burgers'. Then users can jump from another page directly to the linked area of the 'Menu' page.
I've read a few different topics discussing how to do this, but seem unable to get it to work for me.
Can anybody please give me any advice how I can achieve this?

ramblingaroundtherope on "Simple hack, first step elusive? - STOCK Login Widget"

$
0
0

Hi All,

I'm hoping someone can point me in the right direction.

I know this is something that's been asked before - I've found a few threads on the subject; but the most common answer is to use one of many available plugins to do the job - my problem though, is that I'm using several plugins already, and after a round of updates have just settled conflicts - on a knife edge - so everything currently works. I really don't want to risk upsetting the apple cart with another plugin for something which I figure _should_ be straightforward to dirtyhack in the PHP?

I'm trying to hack-out the dashboard link which appears in the login widget area after the user has logged-in (I guess I'd prefer to remove the avatar (they're disabled on the site) and its profile link too, really). I'd ideally like to remove for Subscribers only, but that's not a deal breaker as the groups who need it are shown the admin bar; so everyone could lose widget link(s) without hardship.

I found a function in /includes/general-template.php which returns a register or admin link, and noticed edits there affect the Meta widget, but I'm at a loss to find whatever generates the links for logged-in users in the Login widget area.

Or perhaps I might find whatever spits out the remaining links (RSS/WP.org) in the Meta widget, and hack that instead?

Eternally grateful for any pointers,

Rob

duttasanjib2003 on "hide custom field"

$
0
0

In my wordpress theme i am creat some custom fields like “cp_street, cp_city, cp_mobile_no, cp_company_name” in post details ‘cp_get_ad_details( $post->ID, $cat_id ); ‘all fields display serialy, but i want to like address (cp_street, cp_city) top of page and mobile no.( cp_mobile_no) right side of page and other display same place. Please help me...

Tom7320 on "Check wp-postpass_* auth cookie"

$
0
0

Hi there!

I have a WP site with a couple of password protected pages. After a user has entered the corrrect password WP creates a cookie called wp-postpass_*. I want to check wether or not the user logged in to a specific page correctly within my own PHP script. I found the wp_authenticate_cookie() function but I still don't understand how to use this function within my own script to check for different password protected pages... :-(

Help would be very much appreciated!

THX a lot!

Tom

DatagoniaWeb on "Modifying the Main Loop Query (wp_query->set)"

$
0
0

Good Morning,

I am currently building a website that will be a blog about music and am implementing custom fields and custom post types in several different manners. On my archive-event.php page I specifically want to modify the main loop for that page so that instead of ordering by the date the post (each event is a post of type "event") was published I want them sorted in the archive by the date of a custom field called "start_date".

Currently each start_date field is in the form "yyyy-m->set-dd" and I want to omit posts with a start_date before the current date (so previous events would not show up). Additionally I would like to order the archive of the posts by start_date so that the first post would be the soonest upcoming event.

I was reading a little bit about the pre_get_posts function but was not able to implement it correctly. The two main areas of code for attempting to modify the query are in functions.php and archive-event.php:

Functions.php:

//specifically alter the main query *after* it has been called
add_action('pre_get_posts','alter_events_query');
function alter_events_query($query){
      if( $query->is_main_query() ){
        $query->set( array('meta_key' => 'start_date', 'meta_value' => date('o-m-d'), 'meta_compare' => '>=' ));
      }
}

Event-archive.php:
alter_events_query( );

It should be noted that the "alter_events_query();" line is called immediately after the "get_header" call at the beginning of archive-event.php.

My website is: RaveIsKing.Danconia.US and the page, including error message, is the following (debugging is currently on):
http://raveisking.danconia.us/event/

Any help that could point me in the right direction would be appreciated. I don't know if I am sending the right parameters to the wp_query->set method and it seems that documentation on that method and the "pre_get_posts" isn't very well documented either. Thank you!


steady_ on "Remove page title bar"

$
0
0

i was able to remove the page title it self but im stuck with the page title bar. everything on my website it black and this bar is the only white bar standing out of my black theme

how can i remove it it or change that page title bar to black. i am using a premium theme from thinkupthemes called minimal.

thanks in advance

mrs_C on "hacking into my blog"

$
0
0

Strangers are adding themselves as admin users & posting on my blog without permission. How can I stop this from happening.

They are been a lot lately and I keep deleting them. It is always from the same url which is http://wp.me/p4eMaV-

Any idea how these people are doing this as I log out every time I leave my blog?

Thanks

designtrial on "how to remove it white color in front of slideshow?"

duttasanjib2003 on "custom fields"

$
0
0

In my wordpress theme i am create some custom fields like “cp_street, cp_city, cp_mobile_no, cp_company_name” in post details ‘cp_get_ad_details( $post->ID, $cat_id ); ‘all fields display serially, but i want to like address (cp_street, cp_city) top of page and mobile no.( cp_mobile_no) right side of page and other display same place. Please help me...

Omri on "Integrate additional datasource for the search results"

$
0
0

Hello,

I'm working on a plugin that will access our organization's active directory and will pull data from there and display it in the search results.
I'm unable to find a way to add additional data to the search results.
What I need is to add to the top of the search list my data and display it in a custom way (not like a post).

Thanks for the help.

Viewing all 8245 articles
Browse latest View live