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

WebDevDataAdmin on "Create Dynamic Content (Portfolio Plus Built in Wordpress Slider)"

$
0
0

I was able to change the background for the Single Portfolio Page & Place a built in Wordpress Slider on the page.

I have a unique situation where due to the template I am using, the plug in sliders will not work.

So, my boss is asking me to dynamically change the short description (etc) based on the Meta Data of the photo in the wordpress slider (Caption, etc).

How can this be done? (Hacked using PHP?)

Thanks!


tatof on "wp_rewrite pagetheme - custom Permalink 404"

$
0
0

Hello,

I want to change the perma link on a page theme basis.
This is what i've got so far in my functions.php:

//Change permalink to subject
function change_permalink_themebasis( $post ) {
    $template = get_post_meta( $post->ID, '_wp_page_template' ,true );
    if ( 'page-branches.php' == $template) {
        global $wp_rewrite;
     	$wp_rewrite->page_structure = $wp_rewrite->root . 'branches/%pagename%/';
    } elseif ( 'page-modules.php' == $template) {
	 	global $wp_rewrite;
     	$wp_rewrite->page_structure = $wp_rewrite->root . 'modules/%pagename%/';
	} else{
		global $wp_rewrite;
     	$wp_rewrite->page_structure = $wp_rewrite->root . '%pagename%/';
	}
}
add_action( 'add_meta_boxes_page', 'change_permalink_themebasis' );

It works but the problem is that the front page gives an 404.
How to fix this? I think the problem is the add_action type "add_meta_boxes_page" but I can't find the proper one.

jamiek47 on "Make all images link to post they are inserted into automatically?"

$
0
0

Hi,

Instead of images in a post linking directly to the image, is it possible for them to automatically all link to the posts URL / permalink?

I know I can do this manually, but I have many images in a post and it would save it a lot of time if this could happen automatically?

Thanks,
Jamie

charlescchapmanjr on "reconnecting to old content after an injection attack"

$
0
0

Hi one of the sites i admin got hacked. still not sure how but the host sent me a list of backdoored files. If I scan the old wp-content etc and the files are clean can i just copy them to the new directory like I've read?

What exactly is in my MySQL database and where are the 100 plus pages I've posted in the wordpress folders exactly. having trouble finding answers to these questions online.

wpbond on "How To CODE that Allow Users to Select Multiple Sliders?"

$
0
0

Hello,
I am a beginner PHP and WP Coder.

I have seen it many premium themes and want to achieve that myself.

I want to allow users to select the sliders (FREE ones) that they would like to use from a settings page in the admin.

For eg: If someone wants to use BX slider, he selects it from the drop down I make.

Then if he wants to change it to JS slider he just selects it from the drop down and voila.

Is their any tutorial for it or can anybody give me any direction ?

Thank you

georgesjeandenis on "The Add Media button loads forever with my plugin (add_action "shutdown")"

$
0
0

Since I created my plugin, I see that the "Add Media" button does not load at all. However, when I comment the "shutdown" action, it works.

I created a plugin, it's basically just two custom post types with a few abilities added to them (http://lespointscom.com/a/misc/tcaan/tcaan_members.zip).

However, I noticed that the "shutdown" action, even without anything in it, creates a BUG :
add_action("shutdown", "tcaan_members_debug");

I made sure to empty the "tcaan_members_debug" function like so :

`function tcaan_members_debug()
{
/*
if(!(isset($_GET["post"]) && isset($_GET["action"])))
{
global $TCAAN_Members;
if(get_option("tcaan_show_debug") == 1)
{
$TCAAN_Members->tcaan_debug();
}
else{}
}
*/
}
`

Still, the bug persisted with the same "infinite" loading.
It was only when I decided to comment the add_action itself, that I noticed everything was working fine :

//add_action("shutdown", "tcaan_members_debug");

That seems to mean that "shutdown" does not work at all for wordpress 4.1.1 at least.

chikaNaPripeve on "Content change"

$
0
0

Hi, i'm newbie in WP. I have a problem.
I 'm developer ,and i creating a plugin.
How can i rewrite content on page with WP Api or smth else?
I have URL mysite.ru/apples-green (example) , if "apples-green" already in db - show my content , else error 404. How to do that?

C8W on "XBRL?"


Tufail on "I want to show content Members have purchased."

$
0
0

Hi WordPress Gurus,

My website is using Memberful and I have created a page called "Members Home" where I have inserted each and every product/service link. Now, I only want to show for example if a
- Person A purchase product/service number: 123 I want to only show him that link not other links.

I am using Avada theme, can you guys help? I already tried user base/rose base plugins but they are not going to work, because each member not matter if paid or free they all have "Subscriber" role.

I don't need any suggestions for free members, I only want to hide other product links on the page that members didn't purchased.

slescure on "if function_exists"

$
0
0

I'm modifying an old plugin that has the following line (below). I commented it out, and the plugin still seems to function. I'm just wondering if there's a good reason this code should exist? Any thoughts? I would think get_option would always exist for a WordPress site.....

if( !function_exists('get_option') )
{
require_once('../../../wp-config.php');
}

oldflinty on "skoon theme alignment issues with widgets in Firefox"

$
0
0

Hi all,

I run a webzine and we have had, for as long as I can remember, as pain-in-the-ass issue with the body text alignment with the widgets in FF.

I have gone through the forums and not found much in the way of help, also a few friends with some knowledge of mine, suggested increasing the size of the widgets - I have no idea how this would work, and didn't help.

Here is a post that has the issue in:
http://www.flintmag.com/little-syria-pt2/
If you check it in Chrome or Safari there is no problem, but with FF the text is combined with the widgets.

In my limited knowledge I would have through the CCS for the post section should have a rule that would not allow the text to clash with the widgets.

Any help is massively appreciate.

James

elilui700 on "[Plugin: Share Buttons by AddToAny] Is it possible to share a custom URL?"

$
0
0

Hi. Is it possible to share a different URL than the one where buttons are located? I have a “thank you” page where users arrive at after a successful payment with PayPal. This page is not accessible to the general public because it just display order summary and some instructions. On this page, after successful payment, I would like the users to have the opportunity to share some other deals I offer, which are located on the home page. Basically that means sharing a different URL than the current URL. Thanks

https://wordpress.org/plugins/add-to-any/

misharnet on "Undefined offset"

$
0
0

I am trying to adjust WordPress core Archives Widget so it appears as a nice looking drop down menu. I did it and it works, but when wp_debug is set to true it shows the following Notice: Undefined offset: 1 in C:\xampp...

it is in this code:

<?php
		/**
		 * Filter the arguments for the Archives widget.
		 *
		 * @since 2.8.0
		 *
		 * @see wp_get_archives()
		 *
		 * @param array $args An array of Archives option arguments.
		 */
		$archives = strip_tags(wp_get_archives( apply_filters( 'nsgen_archive_widgets_args', array(
			'type'            => 'monthly',
			'format'          => 'custom',
			'echo'            => 0,
			'after'           => ','
		) ) ) );
		$archives = explode(',', $archives);
		$months = array();
		$years = array();
		// Grab our years first
		foreach ($archives as $archive) {
			$archive = explode(' ', $archive);
			if (isset($archive[1])) {
				array_push($years, $archive[1]);
			}
		}
		$years = array_values(array_unique($years));
		$i = 0;
		foreach ($years as $year) {
		?><li class="nsgen-archive-year"><a><?php
			echo $year;
			?></a><ul><?php
			foreach ($archives as $archive) {
				$archive = explode(' ', $archive);
                                   if ($archive[1] == $year) {
					echo '<li class="nsgen-archive-month"><a href="' .
					// Get the archive link
					get_month_link($year, date("m", strtotime($archive[0] . '-' . $year))) .
					'">' . trim($archive[0]) . '</a></li>';
      			}
			}
			?></ul><?php
		?></li><?php
		}
?>

this part: if ($archive[1] == $year) {
Can some one help, please.

Brandingbox on "Adding prefixes"

$
0
0

Hey,

I am using a template that has a very big wound in its ticket system, and I am trying to work around it. Support is out of the question since the developer quit. The template is perfect for my use except for this issue.

Page: Book and the Blues

On the front page you have posts in columns, ordered by event date. This is a event schedule. When you hover, you have a black buy ticket-button underneath.

The ticket button opens a modal (a popup form) which imports some date-data using an echo and a prefix. This prefix is:

<?php echo '<span>' . date('g:i a', $stime) . ' - ';?></span>
<?php echo '<span>' . date('g:i a', $etime);?></span>

I wanna remove the modal entirely, but first I need to understand the prefix system - as far as my knowledge goes I think you have your very own sheet for prefixes, where you define their name and function. Then you make a code like the one above and voila, the info is displayed, like in the buy ticket-modal.

But where is this usually located? I have the impression this is no .php file?

Furthermore I have made my own text field inside the themes post attributes window, for adding a ticket link, like you add dates and location. These fields give each post (event) their very own date and location information. In the end, I want clicking the buy ticket-buttons under the post feed on the first page to take me directly to an external ticketmaster.

So, in short my goal is to make individual external ticket links for each post. No popup frame, just straight outta compton.

But how would I have to do this to make the button react to whatever I type in my "ticket text field" - as if you click a href with a _blank code? Is this possible?

Thank you so much for saving my life. A big culture center is counting my days.

benh2142 on "How can I offer a 50% deposit to woocommerce."

$
0
0

Hello, I run a handmade items shop and I would like to offer users the option to click a box and for it to reduce the cart amount by 50%. This gives the option for my users to pay 50% upfront via the website and 50% once product is ready to ship, which I will arrange myself.

Is this easy to implement? I assume I could just add a checkbox to some code, which would then say make $totalamount/2. I know a bit of coding but there are just so many files to it, that I get lost.

Thank you


Charles Mabe on "How do I call my scripts in functions.php instead of in header.php?"

$
0
0

I have jQuery and a custom script called in my header:

...
<body <?php body_class(); ?>>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/sidebar.js"></script>
<div id="page" class="hfeed site">
...

How do I call it instead in my functions.php with the rest of my scripts? That part of functions.php looks like this:

/**
 * Enqueue scripts and styles.
 */
function starter_scripts() {
    wp_enqueue_style( 'starter-style', get_stylesheet_uri() );

    wp_enqueue_script( 'starter-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );

    wp_enqueue_script( 'starter-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
        wp_enqueue_script( 'comment-reply' );
    }
}
add_action( 'wp_enqueue_scripts', 'starter_scripts' );

I can't seem to get it working. Thanks.

chickey88 on "Unsure how to add attributes to already-built menu walker"

$
0
0

First time wordpress theme builder! I initially built my site on Foundation's framework and then tweaked it to install it onto Wordpress.

In order to make the top bar menu work, I utilized awshout's Wordpress Menu & Menu Walker to dynamically generate the menu. It works like a charm

I have never built a walker, and this is my first time really diving into the backend of Wordpress, but I'm hitting a roadblock.

What I would like to do is add to the < li > elements tabindex, roles, and titles. Example:

  • Parent/top level links= tabindex='0' + role="menuitem" + aria-haspopup = "true" + custom titles 'About Menu' 'Support Menu' ect.
  • Children links = tabindex='-1' + role="menuitem"

The problem is even after hours of playing I still have no idea WHERE to implement these items on this walker, or even how. My WP installation is local atm for dev, so I cannot share my copy of the WIP.

The Wordpress menu & Walker I have installed.
How the Top Bar looks in plain HTML through Foundation.

radenb on "Changing a Site Logo on scroll"

$
0
0

I'm currently trying to change my site logo when the page scrolls down to a smaller version that rests on the menu bar I have fixed at the top of the page.

I've tried adding the following jQuery

jQuery(window).scroll(function(){
    var fromTopPx = 5;
    var scrolledFromtop = jQuery(window).scrollTop();
    if(scrolledFromtop > fromTopPx){
        jQuery('site-logo').addClass('scrolled');
    }else{
        jQuery('site-logo').removeClass('scrolled');
    }
});

accompanied by the following in the .css

site-logo.scrolled {
	background-image: url(http://localhost:8888/wordpress/wp-content/uploads/2015/03/NIS_Small_Full_LogoEdit_background.png);
	position: fixed;
	z-index: 11;
}

It does not seem to change it at all, any suggestions as to why it may not be working or a better way to go about doing it?

cpuzzuol on "Endpoint Callback Display for Custom Plugin"

$
0
0

I am building a plugin which allows admins to add staff members to a database. I have created a function in my plugin class file...

cp_libstaff_frontend_display()

...which displays a table of every staff member in the database to front-end users. This function is attached to shortcode which displays at the URL:

mysite.com/librarywp/staff-directory

Now what I would like to do is have a link on each staff member's name which takes the user to a page for just that staff member's information. For example,

mysite.com/librarywp/libstaff/1

Where '1' is the ID of the staff member whose individual page should be retrieved. I have created an endpoint for this like so:

public static function cp_libstaff_add_rewrites(){
 add_rewrite_endpoint( 'libstaff', EP_PERMALINK );
}

public static function cp_libstaff_filter_request( $vars ){
  if( !isset( $vars['libstaff'] ) ) $vars['libstaff'] = true;
  return $vars;
}

public static function cp_libstaff_rewrite_catch_libstaff(){
  if( get_query_var( 'libstaff' ) ){

      echo 'WHAT NOW?';
      exit();
  }
}

add_action( 'init', array('Libstaff', 'cp_libstaff_add_rewrites') );
add_action( 'template_redirect', array('Libstaff', 'cp_libstaff_rewrite_catch_libstaff') );
add_filter( 'request', array('Libstaff', 'cp_libstaff_filter_request') );

After this point I am beyond confused about how to proceed with the callback function. Should there be a custom post type created in here somewhere? A template of some sort?

mariahclayton956 on "I'm yes the packet hiking service a head"

$
0
0

I'm yes the packet hiking service a head chain hatter's there was talking about but I just
Alpha Rush Pro wanted to point out something out that you don't have to wait for that tactually start testing it because it a classifier could use existing mechanism such as the No the landowner or Paul to convey information about application specific service chain so you can be done already today still be done even better tomorrow but not the right time to get involved in some other testing and proof-of-concept very good and so we go to open and have a just gotstarted the OP knob a and my observation was that they and so this is a carrier group working with Linux Foundation the it’s a group %uh to develop

http://www.top10workoutsup.com/

Viewing all 8245 articles
Browse latest View live




Latest Images