Switching logo for specific pages on WordPress Avada theme - php

I am using the Avada Wordpress theme. I'd like to switch out the logo depending on the page. I found this thread on stackoverflow and found it very useful
The latest Avada theme has different coding for standard, mobile and sticky header logos. On top of that, each has a retina option. That is where I am having the problem. It is not clear to me how to allow this for the retina options, too. The coding in the logo.php file is different than in the example I sited.
You'll see the section. The "standard" string works, but not the mobile, sticky, or retina. Any thoughts? Here's the full logo.pho code I am using.
<?php
/**
* Logo template.
*
* #author ThemeFusion
* #copyright (c) Copyright by ThemeFusion
* #link http://theme-fusion.com
* #package Avada
* #subpackage Core
*/
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct script access denied.' );
}
$logo_opening_markup = '<div class="';
$logo_closing_markup = '</div>';
if ( 'v7' === Avada()->settings->get( 'header_layout' ) && ! Avada()->settings->get( 'logo_background' ) ) {
$logo_opening_markup = '<li class="fusion-middle-logo-menu-logo ';
$logo_closing_markup = '</li>';
} elseif ( 'v7' === Avada()->settings->get( 'header_layout' ) && Avada()->settings->get( 'logo_background' ) && 'Top' === Avada()->settings->get( 'header_position' ) ) {
$logo_opening_markup = '<li class="fusion-logo-background fusion-middle-logo-menu-logo"><div class="';
$logo_closing_markup = '</div></li>';
} elseif ( Avada()->settings->get( 'logo_background' ) && 'v4' !== Avada()->settings->get( 'header_layout' ) && 'v5' !== Avada()->settings->get( 'header_layout' ) && 'Top' === Avada()->settings->get( 'header_position' ) ) {
$logo_opening_markup = '<div class="fusion-logo-background"><div class="';
$logo_closing_markup = '</div></div>';
}
?>
<?php if ( '' !== Avada()->settings->get( 'logo', 'url' ) || '' !== Avada()->settings->get( 'logo_retina', 'url' ) ) : ?>
<?php echo $logo_opening_markup; // WPCS: XSS ok. ?>fusion-logo" data-margin-top="<?php echo esc_attr( Avada()->settings->get( 'logo_margin', 'top' ) ); ?>" data-margin-bottom="<?php echo esc_attr( Avada()->settings->get( 'logo_margin', 'bottom' ) ); ?>" data-margin-left="<?php echo esc_attr( Avada()->settings->get( 'logo_margin', 'left' ) ); ?>" data-margin-right="<?php echo esc_attr( Avada()->settings->get( 'logo_margin', 'right' ) ); ?>">
<?php elseif ( 'v7' !== Avada()->settings->get( 'header_layout' ) ) : ?>
<?php echo $logo_opening_markup; // WPCS: XSS ok. ?>fusion-logo" data-margin-top="0px" data-margin-bottom="0px" data-margin-left="0px" data-margin-right="0px">
<?php endif; ?>
<?php
/**
* The avada_logo_prepend hook.
*/
do_action( 'avada_logo_prepend' );
$logo_anchor_tag_attributes = '';
$logo_anchor_tag_attributes_array = apply_filters(
'avada_logo_anchor_tag_attributes',
array(
'class' => 'fusion-logo-link',
'href' => ( $custom_link = Avada()->settings->get( 'logo_custom_link' ) ) ? esc_url( $custom_link ) : esc_url( home_url( '/' ) ),
)
);
foreach ( $logo_anchor_tag_attributes_array as $attribute => $value ) {
if ( 'href' === $attribute ) {
$value = esc_url( $value );
} else {
$value = esc_attr( $value );
}
$logo_anchor_tag_attributes .= ' ' . $attribute . '="' . $value . '" ';
}
$logo_alt_attribute = apply_filters( 'avada_logo_alt_tag', get_bloginfo( 'name', 'display' ) . ' ' . __( 'Logo', 'Avada' ) );
?>
<?php if ( ( Avada()->settings->get( 'logo', 'url' ) && '' !== Avada()->settings->get( 'logo', 'url' ) ) || ( Avada()->settings->get( 'logo_retina', 'url' ) && '' !== Avada()->settings->get( 'logo_retina', 'url' ) ) ) : ?>
<a<?php echo $logo_anchor_tag_attributes; // WPCS: XSS ok. ?>>
<?php $standard_logo = Avada()->images->get_logo_image_srcset( 'logo', 'logo_retina' ); ?>
<!-- custom logo -->
<?php
//Movie
if (is_page( 'movie' ))
{
$standard_logo['srcset'] = '/wp-content/uploads/2018/08/SRSM-Logo-Default-01.png';
$standard_logo['url'] = $standard_logo['srcset'];
$retina_logo['srcset'] = '/wp-content/uploads/2018/08/SRSM-Logo-Retina-01.png';
$retina_logo['url'] = $retina_logo['srcset'];
$mobile_logo['srcset'] = '/wp-content/uploads/2018/08/SRSM-Logo-Mobile-01.png';
$mobile_logo['url'] = $mobile_logo['srcset'];
$sticky_logo['srcset'] = '/wp-content/uploads/2018/08/SRSM-Logo-Sticky-01.png';
$sticky_logo['url'] = $sticky_logo['srcset'];
}
?>
<!-- standard logo -->
<img src="<?php echo esc_url_raw( $standard_logo['url'] ); ?>" srcset="<?php echo esc_attr( $standard_logo['srcset'] ); ?>" width="<?php echo esc_attr( $standard_logo['width'] ); ?>" height="<?php echo esc_attr( $standard_logo['height'] ); ?>"<?php echo $standard_logo['style']; // WPCS: XSS ok. ?> alt="<?php echo esc_attr( $logo_alt_attribute ); ?>" retina_logo_url="<?php echo esc_url_raw( $standard_logo['is_retina'] ); ?>" class="fusion-standard-logo" />
<?php
if ( Avada()->settings->get( 'mobile_logo', 'url' ) && '' !== Avada()->settings->get( 'mobile_logo', 'url' ) ) {
$mobile_logo = Avada()->images->get_logo_image_srcset( 'mobile_logo', 'mobile_logo_retina' );
?>
<!-- mobile logo -->
<img src="<?php echo esc_url_raw( $mobile_logo['url'] ); ?>" srcset="<?php echo esc_attr( $mobile_logo['srcset'] ); ?>" width="<?php echo esc_attr( $mobile_logo['width'] ); ?>" height="<?php echo esc_attr( $mobile_logo['height'] ); ?>"<?php echo $mobile_logo['style']; // WPCS: XSS ok. ?> alt="<?php echo esc_attr( $logo_alt_attribute ); ?>" retina_logo_url="<?php echo esc_url_raw( $mobile_logo['is_retina'] ); ?>" class="fusion-mobile-logo" />
<?php } ?>
<?php
if ( Avada()->settings->get( 'sticky_header_logo', 'url' ) && '' !== Avada()->settings->get( 'sticky_header_logo', 'url' ) && ( in_array( Avada()->settings->get( 'header_layout' ), array( 'v1', 'v2', 'v3', 'v6', 'v7' ) ) || ( ( in_array( Avada()->settings->get( 'header_layout' ), array( 'v4', 'v5' ) ) && 'menu_and_logo' === Avada()->settings->get( 'header_sticky_type2_layout' ) ) ) ) ) {
$sticky_logo = Avada()->images->get_logo_image_srcset( 'sticky_header_logo', 'sticky_header_logo_retina' );
?>
<!-- sticky header logo -->
<img src="<?php echo esc_url_raw( $sticky_logo['url'] ); ?>" srcset="<?php echo esc_attr( $sticky_logo['srcset'] ); ?>" width="<?php echo esc_attr( $sticky_logo['width'] ); ?>" height="<?php echo esc_attr( $sticky_logo['height'] ); ?>"<?php echo $sticky_logo['style']; // WPCS: XSS ok. ?> alt="<?php echo esc_attr( $logo_alt_attribute ); ?>" retina_logo_url="<?php echo esc_url_raw( $sticky_logo['is_retina'] ); ?>" class="fusion-sticky-logo" />
<?php } ?>
</a>
<?php endif; ?>
<?php
/**
* The avada_logo_append hook.
*
* #hooked avada_header_content_3 - 10.
*/
do_action( 'avada_logo_append' );
?>
<?php
echo $logo_closing_markup; // WPCS: XSS ok.
/* Omit closing PHP tag to avoid "Headers already sent" issues. */

Related

Gutenberg for WooCommece Product Page in WordPress 6.0+

I wanted to enable Gutenberg for My Single Product Description so I followed this guide
https://dev.to/kalimahapps/enable-gutenberg-edit
function activate_gutenberg_product( $can_edit, $post_type ) {
if ( $post_type == 'product' ) {
$can_edit = true;
}
return $can_edit;
}
add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 );
function enable_taxonomy_rest( $args ) {
$args['show_in_rest'] = true;
return $args;
}
add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' );
add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );
function register_catalog_meta_boxes() {
global $current_screen;
// Make sure gutenberg is loaded before adding the metabox
if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {
add_meta_box( 'catalog-visibility', __( 'Catalog visibility', 'textdomain' ), 'product_data_visibility', 'product', 'side' );
}
}
add_action( 'add_meta_boxes', 'register_catalog_meta_boxes' );
function product_data_visibility( $post ) {
$thepostid = $post->ID;
$product_object = $thepostid ? wc_get_product( $thepostid ) : new WC_Product();
$current_visibility = $product_object->get_catalog_visibility();
$current_featured = wc_bool_to_string( $product_object->get_featured() );
$visibility_options = wc_get_product_visibility_options();
?>
<div class="misc-pub-section" id="catalog-visibility">
<?php esc_html_e( 'Catalog visibility:', 'woocommerce' ); ?>
<strong id="catalog-visibility-display">
<?php
echo isset( $visibility_options[ $current_visibility ] ) ? esc_html( $visibility_options[ $current_visibility ] ) : esc_html( $current_visibility );
if ( 'yes' === $current_featured ) {
echo ', ' . esc_html__( 'Featured', 'woocommerce' );
}
?>
</strong>
<a href="#catalog-visibility"
class="edit-catalog-visibility hide-if-no-js"><?php esc_html_e( 'Edit', 'woocommerce' ); ?></a>
<div id="catalog-visibility-select" class="hide-if-js">
<input type="hidden" name="current_visibility" id="current_visibility"
value="<?php echo esc_attr( $current_visibility ); ?>" />
<input type="hidden" name="current_featured" id="current_featured"
value="<?php echo esc_attr( $current_featured ); ?>" />
<?php
echo '<p>' . esc_html__( 'This setting determines which shop pages products will be listed on.', 'woocommerce' ) . '</p>';
foreach ( $visibility_options as $name => $label ) {
echo '<input type="radio" name="_visibility" id="_visibility_' . esc_attr( $name ) . '" value="' . esc_attr( $name ) . '" ' . checked( $current_visibility, $name, false ) . ' data-label="' . esc_attr( $label ) . '" /> <label for="_visibility_' . esc_attr( $name ) . '" class="selectit">' . esc_html( $label ) . '</label><br />';
}
echo '<br /><input type="checkbox" name="_featured" id="_featured" ' . checked( $current_featured, 'yes', false ) . ' /> <label for="_featured">' . esc_html__( 'This is a featured product', 'woocommerce' ) . '</label><br />';
?>
<p>
<a href="#catalog-visibility"
class="save-post-visibility hide-if-no-js button"><?php esc_html_e( 'OK', 'woocommerce' ); ?></a>
<a href="#catalog-visibility"
class="cancel-post-visibility hide-if-no-js"><?php esc_html_e( 'Cancel', 'woocommerce' ); ?></a>
</p>
</div>
</div>
<?php
}
But I am getting issues with server Overload after adding this to my function.php With this Error while trying to publish anything. - "Publishing failed. The response is not a valid JSON response".
Anyone Knows the reason...I really need help

How to open downloadable products in WooCommerce in new tab

I added a custom download link for my resellers to download product images. But I would like to add target="_blank" rel="noopener noreferrer" attributes to the link.
Here's my custom download link:
// Add a Custom Download File to My Account
add_filter( 'woocommerce_customer_get_downloadable_products', 'my_custom_default_download', 9999, 1 );
function my_custom_default_download( $downloads ) {
if ( is_admin() && !defined('DOING_AJAX') )
return;
// Only on checkout page and logged in users
if ( ! is_wc_endpoint_url() || ! is_user_logged_in() )
return;
$wpuser_object = wp_get_current_user();
$allowed_roles = array( 'administrator', 'default_wholesaler', 'wholesaler-non-vat-registered', 'wholesaler-ex-vat-registered', 'wholesaler-ex-non-vat-registered', 'shop_manager');
if ( array_intersect($allowed_roles, $wpuser_object->roles) ){
$downloads[] = array(
'product_name' => 'Product Images (High Resolution)',
'download_name' => 'Download',
'download_url' => 'https://drive.google.com/drive/folders/',
);
return $downloads;
}
}
Here's the updated my-downloads.php file saved to my child theme:
<?php
defined( 'ABSPATH' ) || exit;
$downloads = WC()->customer->get_downloadable_products();
if ( $downloads ) : ?>
<?php do_action( 'woocommerce_before_available_downloads' ); ?>
<h2><?php echo apply_filters( 'woocommerce_my_account_my_downloads_title', esc_html__( 'Available downloads', 'woocommerce' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h2>
<ul class="woocommerce-Downloads digital-downloads">
<?php foreach ( $downloads as $download ) : ?>
<li>
<?php
do_action( 'woocommerce_available_download_start', $download );
if ( is_numeric( $download['downloads_remaining'] ) ) {
/* translators: %s product name */
echo apply_filters( 'woocommerce_available_download_count', '<span class="woocommerce-Count count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . '</span> ', $download ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo apply_filters( 'woocommerce_available_download_link', '' . $download['download_name'] . '', $download ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
do_action( 'woocommerce_available_download_end', $download );
?>
</li>
<?php endforeach; ?>
</ul>
<?php do_action( 'woocommerce_after_available_downloads' ); ?>
<?php endif; ?>
You've got to update the order-downloads.php file not the my-downloads.php file and save it to the child theme.
Here's the solution:
<?php
/**
* Order Downloads.
*
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-downloads.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* #see https://docs.woocommerce.com/document/template-structure/
* #package WooCommerce\Templates
* #version 3.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<section class="woocommerce-order-downloads">
<?php if ( isset( $show_title ) ) : ?>
<h2 class="woocommerce-order-downloads__title"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></h2>
<?php endif; ?>
<table class="woocommerce-table woocommerce-table--order-downloads shop_table shop_table_responsive order_details">
<thead>
<tr>
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
<th class="<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th>
<?php endforeach; ?>
</tr>
</thead>
<?php foreach ( $downloads as $download ) : ?>
<tr>
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
<td class="<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>">
<?php
if ( has_action( 'woocommerce_account_downloads_column_' . $column_id ) ) {
do_action( 'woocommerce_account_downloads_column_' . $column_id, $download );
} else {
switch ( $column_id ) {
case 'download-product':
if ( $download['product_url'] ) {
echo '' . esc_html( $download['product_name'] ) . '';
} else {
echo esc_html( $download['product_name'] );
}
break;
case 'download-file':
echo '' . esc_html( $download['download_name'] ) . '';
break;
case 'download-remaining':
echo is_numeric( $download['downloads_remaining'] ) ? esc_html( $download['downloads_remaining'] ) : esc_html__( '∞', 'woocommerce' );
break;
case 'download-expires':
if ( ! empty( $download['access_expires'] ) ) {
echo '<time datetime="' . esc_attr( date( 'Y-m-d', strtotime( $download['access_expires'] ) ) ) . '" title="' . esc_attr( strtotime( $download['access_expires'] ) ) . '">' . esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ) . '</time>';
} else {
esc_html_e( 'Never', 'woocommerce' );
}
break;
}
}
?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
</section>

get_the_author_meta is not working in wordpress

here is the code
<?php
/**
* Display detail author of current post
* Use in single post
*
* #since 1.0
*/
?>
<div class="post-author">
<div class="author-img">
<?php if( function_exists('get_simple_local_avatar') ){
if( get_simple_local_avatar( get_the_author_meta( 'ID' ) ) ){
echo get_simple_local_avatar( get_the_author_meta( 'ID' ), '100' );
} else {
echo get_avatar( get_the_author_meta( 'email' ), '100' );
}
} else {
echo get_avatar( get_the_author_meta( 'email' ), '100' );
}
?>
</div>
<div class="author-content">
<h5><?php the_author_posts_link(); ?></h5>
<p><?php the_author_meta( 'description' ); ?></p
<br>
<?php
$bool=0;
if ( get_the_author_meta( 'user_url' ) )
{
$bool = 1;
}
if ( get_the_author_meta( 'facebook' ) )
{
$bool = 1;
}
if ( get_the_author_meta( 'twitter' ) )
{
$bool = 1;
}
if ( get_the_author_meta( 'instagram' ) )
{
$bool = 1;
}
if ( get_the_author_meta( 'pinterest' ) )
{
$bool = 1;
}
if ( get_the_author_meta( 'tumblr' ) )
{
$bool = 1;
}
if ( get_the_author_meta( 'email' ) && get_theme_mod( 'penci_post_author_email' ) )
{
$bool = 1;
}
if($bool==1){
if (get_locale()=='ar') { ?>
<h5 class="connect_with_ar">تواصل مع <?php the_author_posts_link(); ?></h5>
<br>
<?php } else {?>
<h5 class="connect_with">Connect With <?php the_author_posts_link(); ?></h5>
<br>
<?php } } ?>
<?php if ( get_the_author_meta( 'user_url' ) ) : ?>
<a target="_blank" class="author-social" href="<?php the_author_meta( 'user_url'); ?>"><?php penci_fawesome_icon('fas fa-globe'); ?></a>
<?php endif; ?>
<?php if ( get_the_author_meta( 'facebook' ) ) : ?>
<a target="_blank" class="author-social" href="http://facebook.com/<?php echo esc_attr( the_author_meta( 'facebook' ) ); ?>"><?php penci_fawesome_icon('fab fa-facebook-f'); ?></a>
<?php endif; ?>
<?php if ( get_the_author_meta( 'twitter' ) ) : ?>
<a target="_blank" class="author-social" href="http://twitter.com/<?php echo esc_attr( the_author_meta( 'twitter' ) ); ?>"><?php penci_fawesome_icon('fab fa-twitter'); ?></a>
<?php endif; ?>
<?php if ( get_the_author_meta( 'instagram' ) ) : ?>
<a target="_blank" class="author-social" href="http://instagram.com/<?php echo esc_attr( the_author_meta( 'instagram' ) ); ?>"><?php penci_fawesome_icon('fab fa-instagram'); ?></a>
<?php endif; ?>
<?php if ( get_the_author_meta( 'pinterest' ) ) : ?>
<a target="_blank" class="author-social" href="http://pinterest.com/<?php echo esc_attr( the_author_meta( 'pinterest' ) ); ?>"><?php penci_fawesome_icon('fab fa-pinterest'); ?></a>
<?php endif; ?>
<?php if ( get_the_author_meta( 'tumblr' ) ) : ?>
<a target="_blank" class="author-social" href="http://<?php echo esc_attr( the_author_meta( 'tumblr' ) ); ?>.tumblr.com/"><?php penci_fawesome_icon('fab fa-tumblr'); ?></a>
<?php endif; ?>
<?php if ( get_the_author_meta( 'email' ) && get_theme_mod( 'penci_post_author_email' ) ) : ?>
<a class="author-social" href="mailto:<?php echo esc_attr( the_author_meta( 'email' ) ); ?>"><?php penci_fawesome_icon('fas fa-envelope'); ?></a>
<?php endif; ?>
</div>
</div>
this code working for old users
but it does not work with new users
EDIT
all the plugins that I am using in the website are
EDIT 2
if(isset($_GET['author_name'])){
$curauth = get_user_by('slug', $author_name);
}
else{
$curauth = get_userdata(intval($author));
}
Put this code in author.php. Then change the relevant places.
For example.
printf( wp_kses ( __( '<h1 class="page-title">%s</h1>', 'soledad' ), penci_allow_html() ), get_the_author() );
This line 61. Soledad theme -> author.php
You can put
$ curauth-> first_name instead of "get_the_author ()"
$curauth->user_email;
$curauth->first_name;
$curauth->last_name;
This way you can get all the user's variables.

Modify Wordpress Custom Price Plug-In

I tried modifying this plug-in for WordPress:
https://easydigitaldownloads.com/downloads/custom-prices/?utm_campaign=documentation&utm_source=helpscout&utm_medium=doc&utm_term=1975-custom-prices-overview
What I'm trying to achieve is moving the $ sign next to the custom price field or alternatively removing it completely.
/*
* Hook into add to cart post
*/
function edd_cp_purchase_link_top( $download_id ) {
global $edd_options;
$default_price = get_post_meta( $download_id, 'edd_cp_default_price', true );
$min_price = edd_format_amount ( get_post_meta( $download_id, 'edd_cp_min', true ) );
$custom_price = isset( $_GET ['cp_price'] ) ? edd_format_amount( $_GET ['cp_price'] ) : '';
$button_text = get_post_meta( $download_id, 'cp_button_text', true );
if ( empty( $custom_price ) && ! empty( $default_price ) ) {
$custom_price = edd_format_amount( $default_price );
}
if ( edd_cp_has_custom_pricing( $download_id ) && ! edd_single_price_option_mode( $download_id ) ) {
$wrapper_display = '';
$download = new EDD_Download( $download_id );
if ( edd_item_in_cart( $download_id, array() ) && ( ! $download->has_variable_prices() || ! $download->is_single_price_mode() ) ) {
$wrapper_display = 'style="display:none;"';
} ?>
<p class="edd-cp-container" <?php echo $wrapper_display; ?>>
<?php
echo __( 'Name your price', 'edd_cp' );
if ( ! isset( $edd_options['currency_position'] ) || $edd_options['currency_position'] == 'before' ) : ?>
<?php echo edd_currency_filter( '' ); ?> <input type="text" name="edd_cp_price" class="edd_cp_price" value="<?php echo esc_attr( $custom_price ); ?>" size="30" data-min="<?php echo $min_price; ?>" style="width: 40px;" data-default-text="<?php echo esc_attr( $button_text ); ?>" />
<?php else : ?>
<input type="text" name="edd_cp_price" class="edd_cp_price" value="<?php echo esc_attr( $custom_price ); ?>" size="30" data-min="<?php echo $min_price; ?>" style="width: 80px;" data-default-text="<?php echo esc_attr( $button_text ); ?>" /><?php echo edd_currency_filter( '' );
endif;
$min_no_format = floatval( $min_price );
if( !empty( $min_no_format ) ) {
echo ' <small>(min '.edd_currency_filter( ( $min_price ) ).')</small>';
} ?>
</p>
<?php
}
}
add_filter( 'edd_purchase_link_top', 'edd_cp_purchase_link_top' );
/*
* Add additional list item if variable pricing is enabled
*/
function edd_cp_after_price_options_list( $key, $price, $download_id ) {
if( ! edd_cp_has_custom_pricing( $download_id ) ) {
return;
}
if ( ! edd_single_price_option_mode( $download_id ) ) {
return;
}
global $edd_options;
$default_price_option = edd_get_default_variable_price( $download_id );
$display = 'none';
if ( $key === $default_price_option ) {
$display = 'block';
} ?>
<div class="edd-cp-price-option-wrapper" style="display: <?php echo esc_attr( $display ); ?>;">
<?php
echo __( 'Name your price', 'edd_cp' );
if ( ! isset( $edd_options['currency_position'] ) || $edd_options['currency_position'] == 'before' ) : ?>
<?php echo edd_currency_filter( '' ); ?> <input type="text" name="edd_cp_price[<?php echo esc_attr( $key ); ?>]" class="edd_cp_price" value="<?php echo esc_attr( $price['amount'] ); ?>" size="30" data-min="" />
<?php else : ?>
<input type="text" name="edd_cp_price[<?php echo esc_attr( $key ); ?>]" class="edd_cp_price" value="<?php echo esc_attr( $price['amount'] ); ?>" size="30" data-min="" data-default-text="<?php echo esc_attr( $button_text ); ?>" /><?php echo edd_currency_filter( '' );
endif; ?>
</div>
<?php }
add_action( 'edd_after_price_option', 'edd_cp_after_price_options_list', 10, 3 );
See the attached image. This is how it currently looks.
I really appreciate your help!

How to pull link and put into an href?

I have a website that I'm trying to populate with links. Right now, if you look at the website from the computer, you'll see that there's a floating box with text, then dots all over the map. If you hover over one of the dots, it will have the name of the site, along with the time period associated.
http://jeremynative.com/onthissite/
<?php
$i = 0;
while ( have_posts() ) : the_post();
$et_location_lat = get_post_meta( get_the_ID(), '_et_listing_lat', true );
$et_location_lng = get_post_meta( get_the_ID(), '_et_listing_lng', true );
$et_location_rating = '<div class="location-rating"></div>';
if ( ( $et_rating = et_get_rating() ) && 0 != $et_rating )
$et_location_rating = '<div class="location-rating"><span class="et-rating"><span style="' . sprintf( 'width: %dpx;', esc_attr( $et_rating * 17 ) ) . '"></span></span></div>';
if ( '' != $et_location_lat && '' != $et_location_lng ) {
?>
et_add_marker( <?php printf( '%1$d, %2$s, %3$s, \'<div id="et_marker_%1$d" class="et_marker_info"><div class="location-description"> <div class="location-title"> <h2>%4$s </h2> <div class="listing-info"><p>%5$s</p></div> </div> ' . $et_location_rating . ' </div> <!-- .location-description --> </div> <!-- .et_marker_info -->\'',
$i,
esc_html( $et_location_lat ),
esc_html( $et_location_lng ),
get_the_title(),
wp_strip_all_tags( addslashes( get_the_term_list( get_the_ID(), 'listing_type', '', ', ' ) ) )
); ?> );
<?php
}
$i++;
endwhile;
rewind_posts();
?>
Try with
<?php
$i = 0;
while ( have_posts() ) : the_post();
$et_location_lat = get_post_meta( get_the_ID(), '_et_listing_lat', true );
$et_location_lng = get_post_meta( get_the_ID(), '_et_listing_lng', true );
$et_location_rating = '<div class="location-rating"></div>';
if ( ( $et_rating = et_get_rating() ) && 0 != $et_rating )
$et_location_rating = '<div class="location-rating"><span class="et-rating"><span style="' . sprintf( 'width: %dpx;', esc_attr( $et_rating * 17 ) ) . '"></span></span></div>';
if ( '' != $et_location_lat && '' != $et_location_lng ) {
?>
et_add_marker( <?php printf( '%1$d, %2$s, %3$s, \'<div id="et_marker_%1$d" class="et_marker_info"><div class="location-description"> <div class="location-title"><h2>%4$s</h2><div class="listing-info"><p>%5$s</p></div> </div> ' . $et_location_rating . ' </div> <!-- .location-description --> </div> <!-- .et_marker_info -->\'',
$i,
esc_html( $et_location_lat ),
esc_html( $et_location_lng ),
get_the_title(),
wp_strip_all_tags( addslashes( get_the_term_list( get_the_ID(), 'listing_type', '', ', ' ) ) ),
get_the_permalink()
); ?> );
<?php
}
$i++;
endwhile;
rewind_posts();
?>
I added the link inside the title and then used get_the_permalink() function to pull the permalink in.

Categories