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

nathanwinkelmes on "Categories Title Change"

$
0
0

Ok so I have successfully added my categories page and each category lists all of the posts on a new page when you click on the category. The problem is that when you are taken to the specific category page the title still displays as "Categories" rather than the respective category title. I am attaching my code from archive.php in the twentyfourteen theme.

<h1 class="page-title" style="text-transform:uppercase;">
<?php
     if ( is_day() ) :
          printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() );

     elseif ( is_month() ) :
          printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) ) );

     elseif ( is_year() ) :
          printf( __( 'Yearly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyfourteen' ) ) );

     elseif ( is_category('22') ) :
          _e('Featured Articles', 'twentyfourteen');

     else :
          _e( 'Categories', 'twentyfourteen' );

     endif;
?>
</h1>

DjPrison on "Rest API subdomain"

xhatox on "Adding NEW Class to Related Products Images (Woo)"

$
0
0

Hey everyone,

I've been trying to solve this for the last 3 days, but am lost!

Would like to add a new class to the Related Products imgs.
a. Current classes are: .attachment-shop_catalog and .wp-post-image).

b. I would like to change the classes to: attachment-shop_catalog .wp-post-image and<strong> .MyCustomClass</strong> <-- the new class.

I was able to create a wrapper div AROUND the images editing the related.php file, but cannot figure out how to add a class TO the images themselves.

Any help would be GREATLY appreciated! Thank you.

Guido on "Metabox on certain custom page templates only"

$
0
0

Hi folks,

My theme has 2 custom page templates and I want to add a meta box on those to page templates only.

I'm using add_meta_box to create a nice meta box:

function my_metabox() {
	add_meta_box(
		'my-custom-metabox',
		__( 'My metabox', 'text-domain' ),
		'my_metabox_callback',
		'page',
		'side',
		'default'
	);
}
add_action( 'add_meta_boxes', 'my_metabox' );

But now it's displayed on all pages.
How do I display it on my 2 custom page templates only?

Guido

devxpress on "My .htaccess is ovewriting every few minute"

$
0
0

Hi guys,
i'm facing big prb these days, my .htaccess is overwriting every minute and wp-configs.php is added to my ftp,

in my .htaccess i find this line :
RewriteRule ^(.*)-discount$ wp-configs\.php?url=$1-discount [L]

i tried check all files looking for malicious code, installed many plugin for security but unfortuntly, same prb is persisting,
my website now is displayed now in google search result as hacked website.
plz i need really your help;

Tx;

RosaKick on "db_insert_error on wp_insert_post"

$
0
0

I'm making a modified version of a plugin called Event RSVP.
The original plugin works fine, but my version returns the following error:

WP_Error Object
(
    [errors] => Array
        (
            [db_insert_error] => Array
                (
                    [0] => Could not insert post into the database
                )

        )

    [error_data] => Array
        (
        )

)

The code I'm using is:

$post = array(
	    'post_title'     => 'skidaskoli-registration-' . sha1( $name ), //Create unique title. is it necessary ?
	    'post_status'    => 'publish',
	    'post_type'      => 'skidaskoli-registration',
	    'post_parent'    => $event_id,
	    'post_date'      => date( 'Y-m-d H:i:s', time() )
	);
	$post_id = wp_insert_post( $post, true );

code from original plugin is:

$post = array(
	    'post_title'     => 'ersvp-registration-' . sha1( $name ), //Create unique title. is it necessary ?
	    'post_status'    => 'publish',
	    'post_type'      => 'ersvp-registration',
	    'post_parent'    => $event_id,
	    'post_date'      => date( 'Y-m-d H:i:s', time() )
	);
	$post_id = wp_insert_post( $post );

yourfinesthour on "How to remove box around title/text excerpt on slide?"

dinesh422 on "add some flie"

$
0
0

I have found some virus file on my site. i am deleted many time but, i can not find where are coming. when are running that file browser it's blank but it's redirect unicef.org and pron website. i am use plugin Akismet, Categories Images, Yoast SEO and last time i use reCAPTCHA and all fresh wordpress core file.


Kevin on "Using namespaced functions within ajax handlers"

$
0
0

So I am trying to use a namespaced function as the value for my "action" key in my ajax handler, but I'm not sure how to pull this off.

First, here are the relevant links from my php:

namespace Roots\Sage\Extras;
use Roots\Sage\Setup;

function doctor_search() {

   include( locate_template( 'shortcodes/templates/dr-search-results.php') );

}
add_action( 'wp_ajax_sbh_doctor_search', __NAMESPACE__ . '\\doctor_search' );
add_action( 'wp_ajax_nopriv_sbh_doctor_search', __NAMESPACE__ . '\\doctor_search' );

Here is the javascript:

// The Data
	var data = {
	   action : 'sbh_doctor_search',
	    last_name : last_name,
            first_letter : first_letter,
            specialty : specialty,
            languages: languages
	  }

As you can see I am using the functionality included within Sage / Roots. I might repost this over there, but was hoping somebody might be able to help me out here. Thanks.

admiralchip on "Pagination links for custom query in admin dashboard show the same page number"

$
0
0

Hi everyone!
I'm building a custom plugin to store numbers in a database table. Afterwards, the numbers will be outputted on a page in the admin dashboard. The page in question has a url structure that is something like this: "http://localhost/mysite/wp-admin?page=my-slug&op=view&id=1". Everything was going fine until I tried adding pagination to the query results. I used paginate_links() to add the links. When I put the cursor on the page links while on page 1, the page numbers in the links are correct, ie. pagenum=1, pagenum=2. So when i click on "next" or page 2 "&pagenum=2" gets appended to the above url (which is correct). However when i'm on page 2 and i put the cursor on the page links, all the pages are linked as pagenum=2 so consequently clicking on the link to page 3 still takes me to page 2. It's really strange because I used paginate_links() before on the frontend and it worked perfectly. Do I need to do something else since the page is in the admin dashboard?

whatsupskip on "Trying to get property of non-object in link-template.php"

$
0
0

I am not sure what caused this error to start appearing on my pages. On some pages it only shows twice and others it shows four or five times. The full message is:
Notice: Trying to get property of non-object in /public_html/dev/wordpress/wp-includes/link-template.php on line 323

Notice: Trying to get property of non-object in /public_html/dev/wordpress/wp-includes/link-template.php on line 337

From my searching I found that a similar error message occurs when a site is hacked and the link-template.php file name is changed.

The sections of code correspond to the following code:

/**
 * Retrieve the permalink for current page or page ID.
 *
 * Respects page_on_front. Use this one.

*
 * @since 1.5.0
 *
 * @param int|object $post      Optional. Post ID or object.
 * @param bool       $leavename Optional, defaults to false. Whether to keep page name.
 * @param bool       $sample    Optional, defaults to false. Is it a sample permalink.
 * @return string The page permalink.
 */
function get_page_link( $post = false, $leavename = false, $sample = false ) {
	global $wp;
	$post = get_post( $post );

	if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) )
		$link = home_url('/');
	else
		$link = _get_page_link( $post, $leavename, $sample );

	/**
	 * Filter the permalink for a page.
	 *
	 * @since 1.5.0
	 *
	 * @param string $link    The page's permalink.
	 * @param int    $post_id The ID of the page.
	 * @param bool   $sample  Is it a sample permalink.
	 */
	return apply_filters( 'page_link', $link, $post->ID, $sample );
}

Any help would be appreciated.

ososoba on "Automatic "Read more" except for one category"

$
0
0

Hi,

I'd like to automatically add read more tags after x amount of words/characters to my blog with the exception of one category.

The category (social) will contain embedded Tweets and automatically adding a read more tag breaks the Twitter card and stops it from showing up in full on the post listing page. When the blog page is set to show full content, the card shows up well on the post listing page. See screenshot here.

Any ideas on how I can do this or any alternative methods suggested are welcome.

jpacijent on "Email sent by the email that user entered into Email input field in the form"

$
0
0

How can I change forms to be sent by the email that user entered into Email input field in the form and not by the wodpress?
I can't find right $user_email value...I just got it to be send by the loged in user, and that is not what I want.

OllyDowning on "Hide Some Custom Posts"

$
0
0

Hello All,

I have a custom post type which each user is able to edit one of. I want to make it so each user can only see the post they can edit since there are two pages of posts and it takes a long time to find a specific post.

I'm presuming I would have to use a filter but I'm not really sure where I would go from there. All guidance/assistance will be greatly appreciated.

Thanks everyone.

vicentefega on "WordPress hacked, its always loading"

$
0
0

Hi, my wordpress has been hacked. The problem is that is always loading, and never finishes loading the web.

I found a lot of files with this code at the begin:

$sF="PCT4BA6ODSE_";$s21=strtolower($sF[4]...

I've modified all those files.

They have also generated many new files with names likes "star.php", "code.php", "press.php", "page.php"... All they weigh 510bytes, so It was easy to find and eliminate.

After clean all files and remove the new malicious files, my website still does not work! :(

I've searched base64 code in all site files and database and nothing new...

I've also tried the following: When I stop loading the web, I get inspected the code with firebug, and I see in the "head" section, the same two files called innumerable times:

This two files are this and this.

Can someone please help me? I'm going crazy... :(

Thank you so much!


lpotadle on "the_excerpt not showing text only pictures"

$
0
0

I am trying to create a news page and I am using the_excerpt and I have the length set to 20 and the I have modified the read more tag. But It is showing up very wrong. I have used it before and it has worked perfectly now it is showing a copy of the featured image some text and it does not add the read more on every post. On the first on it only shows a random image from the media gallery that is not even in the post.

carlager on "Generic link to most recent post"

$
0
0

Clicking the icon "Logbog" on my website http://www.heron3050.com opens the most recent post

So far I change the link manually when a new post is published

Does anyone know which code I should insert the functions.php to make this happen automatically ?

Functions.phs looks as follows

<?php
/**
* Defining constants
*
* @since 1.0.0
*/
$bavotasan_theme_data = wp_get_theme();
define( 'BAVOTASAN_THEME_URL', get_template_directory_uri() );
define( 'BAVOTASAN_THEME_TEMPLATE', get_template_directory() );
define( 'BAVOTASAN_THEME_VERSION', trim( $bavotasan_theme_data->Version ) );
define( 'BAVOTASAN_THEME_NAME', $bavotasan_theme_data->Name );
define( 'BAVOTASAN_THEME_FILE', get_option( 'template' ) );

/**
* Includes
*
* @since 1.0.0
*/
require( BAVOTASAN_THEME_TEMPLATE . '/library/customizer.php' ); // Functions for theme options page
require( BAVOTASAN_THEME_TEMPLATE . '/library/preview-pro.php' ); // Functions for preview pro page
require( BAVOTASAN_THEME_TEMPLATE . '/library/about.php' ); // Functions for about page
require( BAVOTASAN_THEME_TEMPLATE . '/library/custom-metaboxes.php' ); // Functions for home page alignment

/**
* Prepare the content width
*
* @since 1.0.0
*/
$bavotasan_theme_options = bavotasan_theme_options();
$array_content = array( 'col-md-2' => .1666, 'col-md-3' => .25, 'col-md-4' => .3333, 'col-md-5' => .4166, 'col-md-6' => .5, 'col-md-7' => .5833, 'col-md-8' => .6666, 'col-md-9' => .75, 'col-md-10' => .8333, 'col-md-12' => 1 );
$bavotasan_main_content = $array_content[$bavotasan_theme_options['primary']] * $bavotasan_theme_options['width'] - 30;

if ( ! isset( $content_width ) )
$content_width = round( $bavotasan_main_content );

add_action( 'after_setup_theme', 'bavotasan_setup' );
if ( ! function_exists( 'bavotasan_setup' ) ) :
/**
* Initial setup
*
* This function is attached to the 'after_setup_theme' action hook.
*
* @uses load_theme_textdomain()
* @uses get_locale()
* @uses BAVOTASAN_THEME_TEMPLATE
* @uses add_theme_support()
* @uses add_editor_style()
* @uses add_custom_background()
* @uses add_custom_image_header()
* @uses register_default_headers()
*
* @since 1.0.0
*/
function bavotasan_setup() {
load_theme_textdomain( 'arcade', BAVOTASAN_THEME_TEMPLATE . '/library/languages' );

// Add default posts and comments RSS feed links to <head>.
add_theme_support( 'automatic-feed-links' );

// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style( 'library/css/admin/editor-style.css' );

// This theme uses wp_nav_menu() in two location.
register_nav_menu( 'primary', __( 'Primary Menu', 'arcade' ) );

// Add support for a variety of post formats
add_theme_support( 'post-formats', array( 'gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside' ) );

// This theme uses Featured Images (also known as post thumbnails) for archive pages
add_theme_support( 'post-thumbnails' );
add_image_size( 'half', 570, 220, true );
add_image_size( 'square100', 100, 100, true );

// Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header.
add_theme_support( 'custom-header', array(
'header-text' => false,
'flex-height' => true,
'flex-width' => true,
'random-default' => true,
'width' => apply_filters( 'bavotasan_header_image_width', 1800 ),
'height' => apply_filters( 'bavotasan_header_image_height', 1200 ),
) );

// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
register_default_headers( array(
'header01' => array(
'url' => '%s/library/images/header01.jpg',
'thumbnail_url' => '%s/library/images/header01-thumbnail.jpg',
'description' => __( 'Default Header 1', 'arcade' )
),
) );

// Add support for custom backgrounds
add_theme_support( 'custom-background' );

// Add HTML5 elements
add_theme_support( 'html5', array( 'comment-list', 'comment-form', ) );

// Add title tag support
add_theme_support( 'title-tag' );

// Remove default gallery styles
add_filter( 'use_default_gallery_style', '__return_false' );

// Infinite scroll
add_theme_support( 'infinite-scroll', array(
'type' => 'scroll',
'container' => 'primary',
'wrapper' => false,
'footer' => false,
) );

// Add Woocommerce support
add_theme_support( 'woocommerce' );
}
endif; // bavotasan_setup

add_action( 'pre_get_posts', 'bavotasan_home_page_query' );
/**
* Set up home page query
*
* This function is attached to the 'pre_get_posts' action hook.
*
* @since 1.0.0
*/
function bavotasan_home_page_query( $query ) {
if ( $query->is_home() && $query->is_main_query()&& is_page_template( 'page-templates/template-post-block.php' ) ) {

$query->set( 'ignore_sticky_posts', true );
$query->set( 'posts_per_page', 4 );
}
}

add_action( 'wp_head', 'bavotasan_styles' );
/**
* Add a style block to the theme for the current link color.
*
* This function is attached to the 'wp_head' action hook.
*
* @since 1.0.0
*/
function bavotasan_styles() {
$bavotasan_theme_options = bavotasan_theme_options();
?>
<style>
.container { max-width: <?php echo $bavotasan_theme_options['width']; ?>px; }
</style>
<?php
}

add_action( 'wp_enqueue_scripts', 'bavotasan_add_js' );
if ( ! function_exists( 'bavotasan_add_js' ) ) :
/**
* Load all JavaScript to header
*
* This function is attached to the 'wp_enqueue_scripts' action hook.
*
* @uses is_admin()
* @uses is_singular()
* @uses get_option()
* @uses wp_enqueue_script()
* @uses BAVOTASAN_THEME_URL
*
* @since 1.0.0
*/
function bavotasan_add_js() {
$bavotasan_theme_options = bavotasan_theme_options();

if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );

wp_enqueue_script( 'bootstrap', BAVOTASAN_THEME_URL .'/library/js/bootstrap.min.js', array( 'jquery' ), '3.0.3', true );
wp_enqueue_script( 'fillsize', BAVOTASAN_THEME_URL .'/library/js/fillsize.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'arctext', BAVOTASAN_THEME_URL .'/library/js/jquery.arctext.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'theme_js', BAVOTASAN_THEME_URL .'/library/js/theme.js', array( 'bootstrap' ), '', true );

$fittext = ( empty( $bavotasan_theme_options['fittext'] ) ) ? '' : $bavotasan_theme_options['fittext'];
$arc_text = ( is_front_page() ) ? $bavotasan_theme_options['arc'] : $bavotasan_theme_options['arc_inner'];

wp_localize_script( 'theme_js', 'theme_js_vars', array(
'arc' => absint( $arc_text ),
'fittext' => esc_attr( $fittext ),
) );

wp_enqueue_style( 'theme_stylesheet', get_stylesheet_uri() );
wp_enqueue_style( 'google_fonts', '//fonts.googleapis.com/css?family=Megrim|Raleway|Open+Sans:400,400italic,700,700italic', false, null, 'all' );
wp_enqueue_style( 'font_awesome', BAVOTASAN_THEME_URL .'/library/css/font-awesome.css', false, '4.3.0', 'all' );
}
endif; // bavotasan_add_js

add_action( 'widgets_init', 'bavotasan_widgets_init' );
if ( ! function_exists( 'bavotasan_widgets_init' ) ) :
/**
* Creating the two sidebars
*
* This function is attached to the 'widgets_init' action hook.
*
* @uses register_sidebar()
*
* @since 1.0.0
*/
function bavotasan_widgets_init() {
require( BAVOTASAN_THEME_TEMPLATE . '/library/widgets/widget-image-icon.php' ); // Custom Image/Icon Text widget

register_sidebar( array(
'name' => __( 'First Sidebar', 'arcade' ),
'id' => 'sidebar',
'description' => __( 'This is the first sidebar. It won\'t appear on the home page unless you set a static front page.', 'arcade' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );

register_sidebar( array(
'name' => __( 'Jumbo Headline', 'arcade' ),
'id' => 'jumbo-headline',
'description' => __( 'Area on the home page below the large header image. Designed specifically for one text widget. ', 'arcade' ),
'before_widget' => '<aside id="%1$s" class="jumbo-headline %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1>',
'after_title' => '</h1>',
) );

register_sidebar( array(
'name' => __( 'Home Page Top Area', 'arcade' ),
'id' => 'home-page-top-area',
'description' => __( 'Area on the home page above the main content. Designed specifically for four Icon & Text widgets. Add at least one widget to make it appear.', 'arcade' ),
'before_widget' => '<aside id="%1$s" class="home-widget col-md-3 %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="home-widget-title">',
'after_title' => '</h3>',
) );
}
endif; // bavotasan_widgets_init

/**
* Add pagination
*
* @uses paginate_links()
* @uses add_query_arg()
*
* @since 1.0.0
*/
function bavotasan_pagination() {
global $wp_query, $paged;

// Don't print empty markup if there's only one page.
if ( $wp_query->max_num_pages < 2 && 0 == $paged )
return;
?>
<nav class="navigation clearfix" role="navigation">
<h1 class="sr-only"><?php _e( 'Posts navigation', 'arcade' ); ?></h1>
<?php if ( get_next_posts_link() ) : ?>
<div class="nav-previous"><?php next_posts_link( __( '← Older posts', 'arcade' ) ); ?></div>
<?php endif; ?>

<?php if ( get_previous_posts_link() ) : ?>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts →', 'arcade' ) ); ?></div>
<?php endif; ?>
</nav><!-- .navigation -->
<?php
wp_reset_query();
}

if ( ! function_exists( 'bavotasan_comment' ) ) :
/**
* Callback function for comments
*
* Referenced via wp_list_comments() in comments.php.
*
* @uses get_avatar()
* @uses get_comment_author_link()
* @uses get_comment_date()
* @uses get_comment_time()
* @uses edit_comment_link()
* @uses comment_text()
* @uses comments_open()
* @uses comment_reply_link()
*
* @since 1.0.0
*/
function bavotasan_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;

switch ( $comment->comment_type ) :
case '' :
?>
<li <?php comment_class(); ?>>
<div id="comment-<?php comment_ID(); ?>" class="comment-body">
<div class="comment-avatar">
<?php echo get_avatar( $comment, 60 ); ?>
</div>
<div class="comment-content">
<div class="comment-author">
<?php echo get_comment_author_link() . ' '; ?>
</div>
<div class="comment-meta">
<?php
printf( __( '%1$s at %2$s', 'arcade' ), get_comment_date(), get_comment_time() );
edit_comment_link( __( '(edit)', 'arcade' ), ' ', '' );
?>
</div>
<div class="comment-text">
<?php if ( '0' == $comment->comment_approved ) { echo '' . __( 'Your comment is awaiting moderation.', 'arcade' ) . ''; } ?>
<?php comment_text() ?>
</div>
<?php if ( $args['max_depth'] != $depth && comments_open() && 'pingback' != $comment->comment_type ) { ?>
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div>
<?php } ?>
</div>
</div>
<?php
break;

case 'pingback' :
case 'trackback' :
?>
<li id="comment-<?php comment_ID(); ?>" class="pingback">
<div class="comment-body">
<i class="fa fa-paperclip"></i>
<?php _e( 'Pingback:', 'arcade' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(edit)', 'arcade' ), ' ' ); ?>
</div>
<?php
break;
endswitch;
}
endif; // bavotasan_comment

add_filter( 'excerpt_more', 'bavotasan_excerpt' );
if ( ! function_exists( 'bavotasan_excerpt' ) ) :
/**
* Adds a read more link to all excerpts
*
* This function is attached to the 'excerpt_more' filter hook.
*
* @param int $more
*
* @return Custom excerpt ending
*
* @since 1.0.0
*/
function bavotasan_excerpt( $more ) {
return '…';
}
endif; // bavotasan_excerpt

add_filter( 'wp_trim_excerpt', 'bavotasan_excerpt_more' );
if ( ! function_exists( 'bavotasan_excerpt_more' ) ) :
/**
* Adds a read more link to all excerpts
*
* This function is attached to the 'wp_trim_excerpt' filter hook.
*
* @param string $text
*
* @return Custom read more link
*
* @since 1.0.0
*/
function bavotasan_excerpt_more( $text ) {
if ( is_singular() )
return $text;

return '<p class="excerpt">' . $text . ' ' . __( 'Read more →', 'arcade' ) . '</p>';
}
endif; // bavotasan_excerpt_more

add_filter( 'the_content_more_link', 'bavotasan_content_more_link', 10, 2 );
if ( ! function_exists( 'bavotasan_content_more_link' ) ) :
/**
* Customize read more link for content
*
* This function is attached to the 'the_content_more_link' filter hook.
*
* @param string $link
* @param string $text
*
* @return Custom read more link
*
* @since 1.0.0
*/
function bavotasan_content_more_link( $link, $text ) {
return '' . $text . '';
}
endif; // bavotasan_content_more_link

add_filter( 'excerpt_length', 'bavotasan_excerpt_length', 999 );
if ( ! function_exists( 'bavotasan_excerpt_length' ) ) :
/**
* Custom excerpt length
*
* This function is attached to the 'excerpt_length' filter hook.
*
* @param int $length
*
* @return Custom excerpt length
*
* @since 1.0.0
*/
function bavotasan_excerpt_length( $length ) {
global $bavotasan_custom_excerpt_length;

if ( $bavotasan_custom_excerpt_length )
return $bavotasan_custom_excerpt_length;

return 60;
}
endif; // bavotasan_excerpt_length

/**
* Print the attached image with a link to the next attached image.
*
* @since 1.0.9
*/
function bavotasan_the_attached_image() {
$post = get_post();

$attachment_size = apply_filters( 'bavotasan_attachment_size', array( 810, 810 ) );
$next_attachment_url = wp_get_attachment_url();

$attachment_ids = get_posts( array(
'post_parent' => $post->post_parent,
'fields' => 'ids',
'numberposts' => -1,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID',
) );

if ( count( $attachment_ids ) > 1 ) {
foreach ( $attachment_ids as $attachment_id ) {
if ( $attachment_id == $post->ID ) {
$next_id = current( $attachment_ids );
break;
}
}

if ( $next_id )
$next_attachment_url = get_attachment_link( $next_id );
else
$next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
}

printf( '%2$s',
esc_url( $next_attachment_url ),
wp_get_attachment_image( $post->ID, $attachment_size )
);
}

/**
* Create the required attributes for the #primary container
*
* @since 1.0.0
*/
function bavotasan_primary_attr() {
$bavotasan_theme_options = bavotasan_theme_options();
$class = $bavotasan_theme_options['primary'];
$class = ( 'left' == $bavotasan_theme_options['layout'] ) ? $class . ' pull-right' : $class;

echo 'class="' . $class . ' hfeed"';
}

/**
* Create the required classes for the #secondary sidebar container
*
* @since 1.0.0
*/
function bavotasan_sidebar_class() {
$bavotasan_theme_options = bavotasan_theme_options();
$primary = str_replace( 'col-md-', '', $bavotasan_theme_options['primary'] );
$class = 'col-md-' . ( 12 - $primary );

echo 'class="' . $class . '"';
}

/**
* Default menu
*
* Referenced via wp_nav_menu() in header.php.
*
* @since 1.0.0
*/
function bavotasan_default_menu( $args ) {
extract( $args );

$output = wp_list_categories( array(
'title_li' => '',
'echo' => 0,
'number' => 5,
'depth' => 1,
) );
echo "<ul class='$menu_class'>$output";
}

/**
* Add bootstrap classes to menu items
*
* @since 1.0.0
*/
class Bavotasan_Page_Navigation_Walker extends Walker_Nav_Menu {
function check_current( $classes ) {
return preg_match( '/(current[-_])|active|dropdown/', $classes );
}

function start_lvl( &$output, $depth = 0, $args = array() ) {
$output .= "\n<ul class=\"dropdown-menu\">\n";
}

function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$item_html = '';
parent::start_el( $item_html, $item, $depth, $args );

if ( $item->is_dropdown && ( $depth === 0 ) ) {
$item_html = str_replace( '<a', '<a class="dropdown-toggle" data-toggle="dropdown" data-target="#"', $item_html );
$item_html = str_replace( '', ' <span class="caret"></span>', $item_html );
} elseif ( stristr( $item_html, 'li class="divider' ) ) {
$item_html = preg_replace( '/<a[^>]*>.*?<\/a>/iU', '', $item_html );
} elseif ( stristr( $item_html, 'li class="nav-header' ) ) {
$item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html );
}

$output .= $item_html;
}

function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
$element->is_dropdown = !empty( $children_elements[$element->ID] );

if ( $element->is_dropdown ) {
if ( $depth === 0 ) {
$element->classes[] = 'dropdown';
} elseif ( $depth > 0 ) {
$element->classes[] = 'dropdown-submenu';
}
}
$element->classes[] = ( $element->current || in_array( 'current-menu-parent', $element->classes ) ) ? 'active' : '';

parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
}
}

add_filter( 'wp_nav_menu_args', 'bavotasan_nav_menu_args' );
/**
* Set our new walker only if a menu is assigned and a child theme hasn't modified it to one level deep
*
* This function is attached to the 'wp_nav_menu_args' filter hook.
*
* @author Kirk Wight <http://kwight.ca/adding-a-sub-menu-indicator-to-parent-menu-items/>
* @since 1.0.0
*/
function bavotasan_nav_menu_args( $args ) {
if ( 1 !== $args[ 'depth' ] && has_nav_menu( 'primary' ) && 'primary' == $args[ 'theme_location' ] )
$args[ 'walker' ] = new Bavotasan_Page_Navigation_Walker;

return $args;
}

/**
* Display either the home page slider, custom image or default header image
*
* @since 1.0.0
*/
function bavotasan_header_images() {
global $post;
$post_id = ( is_attachment() && isset( $post->post_parent ) ) ? $post->post_parent : get_queried_object_id();
$custom_image = ( is_singular() || get_option( 'page_for_posts' ) == $post_id || is_attachment() ) ? get_post_meta( $post_id, 'arcade_basic_custom_image', true ) : '';

if ( $custom_image ) {
echo '<img src="' . esc_url( $custom_image ) . '" alt="" class="header-img" />';
} else {
if ( $header_image = get_header_image() ) :
?>
<img class="header-img" src="<?php header_image(); ?>" alt="" />
<?php
endif;
}
}

/**
* Gathers icons from Font Awesome stylesheet
*
* @since 1.0.0
*/
function bavotasan_font_awesome_icons( $display_name = true ) {
$icons = array( 'fa-glass' => '\f000', 'fa-music' => '\f001', 'fa-search' => '\f002', 'fa-envelope-o' => '\f003', 'fa-heart' => '\f004', 'fa-star' => '\f005', 'fa-star-o' => '\f006', 'fa-user' => '\f007', 'fa-film' => '\f008', 'fa-th-large' => '\f009', 'fa-th' => '\f00a', 'fa-th-list' => '\f00b', 'fa-check' => '\f00c', 'fa-times' => '\f00d', 'fa-search-plus' => '\f00e', 'fa-search-minus' => '\f010', 'fa-power-off' => '\f011', 'fa-signal' => '\f012', 'fa-cog' => '\f013', 'fa-trash-o' => '\f014', 'fa-home' => '\f015', 'fa-file-o' => '\f016', 'fa-clock-o' => '\f017', 'fa-road' => '\f018', 'fa-download' => '\f019', 'fa-arrow-circle-o-down' => '\f01a', 'fa-arrow-circle-o-up' => '\f01b', 'fa-inbox' => '\f01c', 'fa-play-circle-o' => '\f01d', 'fa-repeat' => '\f01e', 'fa-refresh' => '\f021', 'fa-list-alt' => '\f022', 'fa-lock' => '\f023', 'fa-flag' => '\f024', 'fa-headphones' => '\f025', 'fa-volume-off' => '\f026', 'fa-volume-down' => '\f027', 'fa-volume-up' => '\f028', 'fa-qrcode' => '\f029', 'fa-barcode' => '\f02a', 'fa-tag' => '\f02b', 'fa-tags' => '\f02c', 'fa-book' => '\f02d', 'fa-bookmark' => '\f02e', 'fa-print' => '\f02f', 'fa-camera' => '\f030', 'fa-font' => '\f031', 'fa-bold' => '\f032', 'fa-italic' => '\f033', 'fa-text-height' => '\f034', 'fa-text-width' => '\f035', 'fa-align-left' => '\f036', 'fa-align-center' => '\f037', 'fa-align-right' => '\f038', 'fa-align-justify' => '\f039', 'fa-list' => '\f03a', 'fa-outdent' => '\f03b', 'fa-indent' => '\f03c', 'fa-video-camera' => '\f03d', 'fa-picture-o' => '\f03e', 'fa-pencil' => '\f040', 'fa-map-marker' => '\f041', 'fa-adjust' => '\f042', 'fa-tint' => '\f043', 'fa-pencil-square-o' => '\f044', 'fa-share-square-o' => '\f045', 'fa-check-square-o' => '\f046', 'fa-arrows' => '\f047', 'fa-step-backward' => '\f048', 'fa-fast-backward' => '\f049', 'fa-backward' => '\f04a', 'fa-play' => '\f04b', 'fa-pause' => '\f04c', 'fa-stop' => '\f04d', 'fa-forward' => '\f04e', 'fa-fast-forward' => '\f050', 'fa-step-forward' => '\f051', 'fa-eject' => '\f052', 'fa-chevron-left' => '\f053', 'fa-chevron-right' => '\f054', 'fa-plus-circle' => '\f055', 'fa-minus-circle' => '\f056', 'fa-times-circle' => '\f057', 'fa-check-circle' => '\f058', 'fa-question-circle' => '\f059', 'fa-info-circle' => '\f05a', 'fa-crosshairs' => '\f05b', 'fa-times-circle-o' => '\f05c', 'fa-check-circle-o' => '\f05d', 'fa-ban' => '\f05e', 'fa-arrow-left' => '\f060', 'fa-arrow-right' => '\f061', 'fa-arrow-up' => '\f062', 'fa-arrow-down' => '\f063', 'fa-share' => '\f064', 'fa-expand' => '\f065', 'fa-compress' => '\f066', 'fa-plus' => '\f067', 'fa-minus' => '\f068', 'fa-asterisk' => '\f069', 'fa-exclamation-circle' => '\f06a', 'fa-gift' => '\f06b', 'fa-leaf' => '\f06c', 'fa-fire' => '\f06d', 'fa-eye' => '\f06e', 'fa-eye-slash' => '\f070', 'fa-exclamation-triangle' => '\f071', 'fa-plane' => '\f072', 'fa-calendar' => '\f073', 'fa-random' => '\f074', 'fa-comment' => '\f075', 'fa-magnet' => '\f076', 'fa-chevron-up' => '\f077', 'fa-chevron-down' => '\f078', 'fa-retweet' => '\f079', 'fa-shopping-cart' => '\f07a', 'fa-folder' => '\f07b', 'fa-folder-open' => '\f07c', 'fa-arrows-v' => '\f07d', 'fa-arrows-h' => '\f07e', 'fa-bar-chart' => '\f080', 'fa-twitter-square' => '\f081', 'fa-facebook-square' => '\f082', 'fa-camera-retro' => '\f083', 'fa-key' => '\f084', 'fa-cogs' => '\f085', 'fa-comments' => '\f086', 'fa-thumbs-o-up' => '\f087', 'fa-thumbs-o-down' => '\f088', 'fa-star-half' => '\f089', 'fa-heart-o' => '\f08a', 'fa-sign-out' => '\f08b', 'fa-linkedin-square' => '\f08c', 'fa-thumb-tack' => '\f08d', 'fa-external-link' => '\f08e', 'fa-sign-in' => '\f090', 'fa-trophy' => '\f091', 'fa-github-square' => '\f092', 'fa-upload' => '\f093', 'fa-lemon-o' => '\f094', 'fa-phone' => '\f095', 'fa-square-o' => '\f096', 'fa-bookmark-o' => '\f097', 'fa-phone-square' => '\f098', 'fa-twitter' => '\f099', 'fa-facebook' => '\f09a', 'fa-github' => '\f09b', 'fa-unlock' => '\f09c', 'fa-credit-card' => '\f09d', 'fa-rss' => '\f09e', 'fa-hdd-o' => '\f0a0', 'fa-bullhorn' => '\f0a1', 'fa-bell' => '\f0f3', 'fa-certificate' => '\f0a3', 'fa-hand-o-right' => '\f0a4', 'fa-hand-o-left' => '\f0a5', 'fa-hand-o-up' => '\f0a6', 'fa-hand-o-down' => '\f0a7', 'fa-arrow-circle-left' => '\f0a8', 'fa-arrow-circle-right' => '\f0a9', 'fa-arrow-circle-up' => '\f0aa', 'fa-arrow-circle-down' => '\f0ab', 'fa-globe' => '\f0ac', 'fa-wrench' => '\f0ad', 'fa-tasks' => '\f0ae', 'fa-filter' => '\f0b0', 'fa-briefcase' => '\f0b1', 'fa-arrows-alt' => '\f0b2', 'fa-users' => '\f0c0', 'fa-link' => '\f0c1', 'fa-cloud' => '\f0c2', 'fa-flask' => '\f0c3', 'fa-scissors' => '\f0c4', 'fa-files-o' => '\f0c5', 'fa-paperclip' => '\f0c6', 'fa-floppy-o' => '\f0c7', 'fa-square' => '\f0c8', 'fa-bars' => '\f0c9', 'fa-list-ul' => '\f0ca', 'fa-list-ol' => '\f0cb', 'fa-strikethrough' => '\f0cc', 'fa-underline' => '\f0cd', 'fa-table' => '\f0ce', 'fa-magic' => '\f0d0', 'fa-truck' => '\f0d1', 'fa-pinterest' => '\f0d2', 'fa-pinterest-square' => '\f0d3', 'fa-google-plus-square' => '\f0d4', 'fa-google-plus' => '\f0d5', 'fa-money' => '\f0d6', 'fa-caret-down' => '\f0d7', 'fa-caret-up' => '\f0d8', 'fa-caret-left' => '\f0d9', 'fa-caret-right' => '\f0da', 'fa-columns' => '\f0db', 'fa-sort' => '\f0dc', 'fa-sort-desc' => '\f0dd', 'fa-sort-asc' => '\f0de', 'fa-envelope' => '\f0e0', 'fa-linkedin' => '\f0e1', 'fa-undo' => '\f0e2', 'fa-gavel' => '\f0e3', 'fa-tachometer' => '\f0e4', 'fa-comment-o' => '\f0e5', 'fa-comments-o' => '\f0e6', 'fa-bolt' => '\f0e7', 'fa-sitemap' => '\f0e8', 'fa-umbrella' => '\f0e9', 'fa-clipboard' => '\f0ea', 'fa-lightbulb-o' => '\f0eb', 'fa-exchange' => '\f0ec', 'fa-cloud-download' => '\f0ed', 'fa-cloud-upload' => '\f0ee', 'fa-user-md' => '\f0f0', 'fa-stethoscope' => '\f0f1', 'fa-suitcase' => '\f0f2', 'fa-bell-o' => '\f0a2', 'fa-coffee' => '\f0f4', 'fa-cutlery' => '\f0f5', 'fa-file-text-o' => '\f0f6', 'fa-building-o' => '\f0f7', 'fa-hospital-o' => '\f0f8', 'fa-ambulance' => '\f0f9', 'fa-medkit' => '\f0fa', 'fa-fighter-jet' => '\f0fb', 'fa-beer' => '\f0fc', 'fa-h-square' => '\f0fd', 'fa-plus-square' => '\f0fe', 'fa-angle-double-left' => '\f100', 'fa-angle-double-right' => '\f101', 'fa-angle-double-up' => '\f102', 'fa-angle-double-down' => '\f103', 'fa-angle-left' => '\f104', 'fa-angle-right' => '\f105', 'fa-angle-up' => '\f106', 'fa-angle-down' => '\f107', 'fa-desktop' => '\f108', 'fa-laptop' => '\f109', 'fa-tablet' => '\f10a', 'fa-mobile' => '\f10b', 'fa-circle-o' => '\f10c', 'fa-quote-left' => '\f10d', 'fa-quote-right' => '\f10e', 'fa-spinner' => '\f110', 'fa-circle' => '\f111', 'fa-reply' => '\f112', 'fa-github-alt' => '\f113', 'fa-folder-o' => '\f114', 'fa-folder-open-o' => '\f115', 'fa-smile-o' => '\f118', 'fa-frown-o' => '\f119', 'fa-meh-o' => '\f11a', 'fa-gamepad' => '\f11b', 'fa-keyboard-o' => '\f11c', 'fa-flag-o' => '\f11d', 'fa-flag-checkered' => '\f11e', 'fa-terminal' => '\f120', 'fa-code' => '\f121', 'fa-reply-all' => '\f122', 'fa-star-half-o' => '\f123', 'fa-location-arrow' => '\f124', 'fa-crop' => '\f125', 'fa-code-fork' => '\f126', 'fa-chain-broken' => '\f127', 'fa-question' => '\f128', 'fa-info' => '\f129', 'fa-exclamation' => '\f12a', 'fa-superscript' => '\f12b', 'fa-subscript' => '\f12c', 'fa-eraser' => '\f12d', 'fa-puzzle-piece' => '\f12e', 'fa-microphone' => '\f130', 'fa-microphone-slash' => '\f131', 'fa-shield' => '\f132', 'fa-calendar-o' => '\f133', 'fa-fire-extinguisher' => '\f134', 'fa-rocket' => '\f135', 'fa-maxcdn' => '\f136', 'fa-chevron-circle-left' => '\f137', 'fa-chevron-circle-right' => '\f138', 'fa-chevron-circle-up' => '\f139', 'fa-chevron-circle-down' => '\f13a', 'fa-html5' => '\f13b', 'fa-css3' => '\f13c', 'fa-anchor' => '\f13d', 'fa-unlock-alt' => '\f13e', 'fa-bullseye' => '\f140', 'fa-ellipsis-h' => '\f141', 'fa-ellipsis-v' => '\f142', 'fa-rss-square' => '\f143', 'fa-play-circle' => '\f144', 'fa-ticket' => '\f145', 'fa-minus-square' => '\f146', 'fa-minus-square-o' => '\f147', 'fa-level-up' => '\f148', 'fa-level-down' => '\f149', 'fa-check-square' => '\f14a', 'fa-pencil-square' => '\f14b', 'fa-external-link-square' => '\f14c', 'fa-share-square' => '\f14d', 'fa-compass' => '\f14e', 'fa-caret-square-o-down' => '\f150', 'fa-caret-square-o-up' => '\f151', 'fa-caret-square-o-right' => '\f152', 'fa-eur' => '\f153', 'fa-gbp' => '\f154', 'fa-usd' => '\f155', 'fa-inr' => '\f156', 'fa-jpy' => '\f157', 'fa-rub' => '\f158', 'fa-krw' => '\f159', 'fa-btc' => '\f15a', 'fa-file' => '\f15b', 'fa-file-text' => '\f15c', 'fa-sort-alpha-asc' => '\f15d', 'fa-sort-alpha-desc' => '\f15e', 'fa-sort-amount-asc' => '\f160', 'fa-sort-amount-desc' => '\f161', 'fa-sort-numeric-asc' => '\f162', 'fa-sort-numeric-desc' => '\f163', 'fa-thumbs-up' => '\f164', 'fa-thumbs-down' => '\f165', 'fa-youtube-square' => '\f166', 'fa-youtube' => '\f167', 'fa-xing' => '\f168', 'fa-xing-square' => '\f169', 'fa-youtube-play' => '\f16a', 'fa-dropbox' => '\f16b', 'fa-stack-overflow' => '\f16c', 'fa-instagram' => '\f16d', 'fa-flickr' => '\f16e', 'fa-adn' => '\f170', 'fa-bitbucket' => '\f171', 'fa-bitbucket-square' => '\f172', 'fa-tumblr' => '\f173', 'fa-tumblr-square' => '\f174', 'fa-long-arrow-down' => '\f175', 'fa-long-arrow-up' => '\f176', 'fa-long-arrow-left' => '\f177', 'fa-long-arrow-right' => '\f178', 'fa-apple' => '\f179', 'fa-windows' => '\f17a', 'fa-android' => '\f17b', 'fa-linux' => '\f17c', 'fa-dribbble' => '\f17d', 'fa-skype' => '\f17e', 'fa-foursquare' => '\f180', 'fa-trello' => '\f181', 'fa-female' => '\f182', 'fa-male' => '\f183', 'fa-gratipay' => '\f184', 'fa-sun-o' => '\f185', 'fa-moon-o' => '\f186', 'fa-archive' => '\f187', 'fa-bug' => '\f188', 'fa-vk' => '\f189', 'fa-weibo' => '\f18a', 'fa-renren' => '\f18b', 'fa-pagelines' => '\f18c', 'fa-stack-exchange' => '\f18d', 'fa-arrow-circle-o-right' => '\f18e', 'fa-arrow-circle-o-left' => '\f190', 'fa-caret-square-o-left' => '\f191', 'fa-dot-circle-o' => '\f192', 'fa-wheelchair' => '\f193', 'fa-vimeo-square' => '\f194', 'fa-try' => '\f195', 'fa-plus-square-o' => '\f196', 'fa-space-shuttle' => '\f197', 'fa-slack' => '\f198', 'fa-envelope-square' => '\f199', 'fa-wordpress' => '\f19a', 'fa-openid' => '\f19b', 'fa-university' => '\f19c', 'fa-graduation-cap' => '\f19d', 'fa-yahoo' => '\f19e', 'fa-google' => '\f1a0', 'fa-reddit' => '\f1a1', 'fa-reddit-square' => '\f1a2', 'fa-stumbleupon-circle' => '\f1a3', 'fa-stumbleupon' => '\f1a4', 'fa-delicious' => '\f1a5', 'fa-digg' => '\f1a6', 'fa-pied-piper' => '\f1a7', 'fa-pied-piper-alt' => '\f1a8', 'fa-drupal' => '\f1a9', 'fa-joomla' => '\f1aa', 'fa-language' => '\f1ab', 'fa-fax' => '\f1ac', 'fa-building' => '\f1ad', 'fa-child' => '\f1ae', 'fa-paw' => '\f1b0', 'fa-spoon' => '\f1b1', 'fa-cube' => '\f1b2', 'fa-cubes' => '\f1b3', 'fa-behance' => '\f1b4', 'fa-behance-square' => '\f1b5', 'fa-steam' => '\f1b6', 'fa-steam-square' => '\f1b7', 'fa-recycle' => '\f1b8', 'fa-car' => '\f1b9', 'fa-taxi' => '\f1ba', 'fa-tree' => '\f1bb', 'fa-spotify' => '\f1bc', 'fa-deviantart' => '\f1bd', 'fa-soundcloud' => '\f1be', 'fa-database' => '\f1c0', 'fa-file-pdf-o' => '\f1c1', 'fa-file-word-o' => '\f1c2', 'fa-file-excel-o' => '\f1c3', 'fa-file-powerpoint-o' => '\f1c4', 'fa-file-image-o' => '\f1c5', 'fa-file-archive-o' => '\f1c6', 'fa-file-audio-o' => '\f1c7', 'fa-file-video-o' => '\f1c8', 'fa-file-code-o' => '\f1c9', 'fa-vine' => '\f1ca', 'fa-codepen' => '\f1cb', 'fa-jsfiddle' => '\f1cc', 'fa-life-ring' => '\f1cd', 'fa-circle-o-notch' => '\f1ce', 'fa-rebel' => '\f1d0', 'fa-empire' => '\f1d1', 'fa-git-square' => '\f1d2', 'fa-git' => '\f1d3', 'fa-hacker-news' => '\f1d4', 'fa-tencent-weibo' => '\f1d5', 'fa-qq' => '\f1d6', 'fa-weixin' => '\f1d7', 'fa-paper-plane' => '\f1d8', 'fa-paper-plane-o' => '\f1d9', 'fa-history' => '\f1da', 'fa-circle-thin' => '\f1db', 'fa-header' => '\f1dc', 'fa-paragraph' => '\f1dd', 'fa-sliders' => '\f1de', 'fa-share-alt' => '\f1e0', 'fa-share-alt-square' => '\f1e1', 'fa-bomb' => '\f1e2', 'fa-futbol-o' => '\f1e3', 'fa-tty' => '\f1e4', 'fa-binoculars' => '\f1e5', 'fa-plug' => '\f1e6', 'fa-slideshare' => '\f1e7', 'fa-twitch' => '\f1e8', 'fa-yelp' => '\f1e9', 'fa-newspaper-o' => '\f1ea', 'fa-wifi' => '\f1eb', 'fa-calculator' => '\f1ec', 'fa-paypal' => '\f1ed', 'fa-google-wallet' => '\f1ee', 'fa-cc-visa' => '\f1f0', 'fa-cc-mastercard' => '\f1f1', 'fa-cc-discover' => '\f1f2', 'fa-cc-amex' => '\f1f3', 'fa-cc-paypal' => '\f1f4', 'fa-cc-stripe' => '\f1f5', 'fa-bell-slash' => '\f1f6', 'fa-bell-slash-o' => '\f1f7', 'fa-trash' => '\f1f8', 'fa-copyright' => '\f1f9', 'fa-at' => '\f1fa', 'fa-eyedropper' => '\f1fb', 'fa-paint-brush' => '\f1fc', 'fa-birthday-cake' => '\f1fd', 'fa-area-chart' => '\f1fe', 'fa-pie-chart' => '\f200', 'fa-line-chart' => '\f201', 'fa-lastfm' => '\f202', 'fa-lastfm-square' => '\f203', 'fa-toggle-off' => '\f204', 'fa-toggle-on' => '\f205', 'fa-bicycle' => '\f206', 'fa-bus' => '\f207', 'fa-ioxhost' => '\f208', 'fa-angellist' => '\f209', 'fa-cc' => '\f20a', 'fa-ils' => '\f20b', 'fa-meanpath' => '\f20c', 'fa-buysellads' => '\f20d', 'fa-connectdevelop' => '\f20e', 'fa-dashcube' => '\f210', 'fa-forumbee' => '\f211', 'fa-leanpub' => '\f212', 'fa-sellsy' => '\f213', 'fa-shirtsinbulk' => '\f214', 'fa-simplybuilt' => '\f215', 'fa-skyatlas' => '\f216', 'fa-cart-plus' => '\f217', 'fa-cart-arrow-down' => '\f218', 'fa-diamond' => '\f219', 'fa-ship' => '\f21a', 'fa-user-secret' => '\f21b', 'fa-motorcycle' => '\f21c', 'fa-street-view' => '\f21d', 'fa-heartbeat' => '\f21e', 'fa-venus' => '\f221', 'fa-mars' => '\f222', 'fa-mercury' => '\f223', 'fa-transgender' => '\f224', 'fa-transgender-alt' => '\f225', 'fa-venus-double' => '\f226', 'fa-mars-double' => '\f227', 'fa-venus-mars' => '\f228', 'fa-mars-stroke' => '\f229', 'fa-mars-stroke-v' => '\f22a', 'fa-mars-stroke-h' => '\f22b', 'fa-neuter' => '\f22c', 'fa-facebook-official' => '\f230', 'fa-pinterest-p' => '\f231', 'fa-whatsapp' => '\f232', 'fa-server' => '\f233', 'fa-user-plus' => '\f234', 'fa-user-times' => '\f235', 'fa-bed' => '\f236', 'fa-viacoin' => '\f237', 'fa-train' => '\f238', 'fa-subway' => '\f239', 'fa-medium' => '\f23a' );
?>
<div class="font-awesome-picker">
<?php
foreach ( $icons as $icon => $code ) {
?>
<div class="c4" data-value="<?php echo $icon; ?>"><div><i class="fa <?php echo $icon; ?>"></i><?php if ( $display_name ) echo $icon; ?></div></div>
<?php
}
?>
</div>
<?php
}

add_filter( 'body_class', 'bavotasan_body_class' );
/**
* Add body class
*
* @since 1.0.0
*/
function bavotasan_body_class( $classes ) {
$bavotasan_theme_options = bavotasan_theme_options();

global $paged;

if ( is_front_page() && 2 > $paged )
$classes[] = 'only-on-home';

if ( empty( $bavotasan_theme_options['fittext'] ) )
$classes[] = 'no-fittext';

$classes[] = 'basic';

return $classes;
}

add_filter( 'post_class', 'bavotasan_post_class' );
/**
* Add post class
*
* @since 1.0.0
*/
function bavotasan_post_class( $classes ) {
$classes[] = 'xfolkentry';

return $classes;
}

/**
* Display a post thumbnail if one exists and use the correct size/class
*
* @since 1.0.3
*/
function bavotasan_display_post_thumbnail() {
if( ! is_single() && has_post_thumbnail() ) {
global $home_page_post, $paged;
$class = ( $home_page_post ) ? 'first-post' : 'alignleft';
$size = ( $home_page_post ) ? 'half' : 'square100';
$size = ( ! is_page_template( 'page-templates/template-post-block.php' ) || 1 < $paged ) ? 'thumbnail' : $size;
?>
">
<?php the_post_thumbnail( $size, array( 'class' => $class ) ); ?>

<?php
}
}

/**
* Woocommerce compatibility
*
* @since 1.0.8
*/
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );

add_action('woocommerce_before_main_content', 'bavotasan_wrapper_start', 10 );
function bavotasan_wrapper_start() {
?>
<div class="container">
<div class="row">
<div id="primary" class="col-md-12">
<?php
}

add_action('woocommerce_after_main_content', 'bavotasan_wrapper_end', 10 );
function bavotasan_wrapper_end() {
?>
</div>
</div>
</div>
<?php
}

Coolcash4live on "How to replace comment URL field with PHONE Number of commenters"

$
0
0

Good morning leaders,

I've been reading all over the web for more than four hours but all the tutorials does not address a NEWBIE what to put into the functions.php and where "specifically" to put it; beginning or at the end of the page.

My challenge is: my website is http://www.allianceinmotionnigeria.com/blog and I want to make sure that all comments that is submitted on the website collects these data:

1. Full Name
2. Email (not compulsory for commenting as against the default rules by Wordpress)
3. Phone (HIGHLY REQUIRED for commenting)
4. Location
5. Comment

I'd be very glad if someone could just help me with the right code to input into the functions.php that will render these features.

NB: I have added a hook to unset 'URL' function before if you check the site. Kindly let me know if I should remove this entirely.

Please help me and I will be very grateful for your help in this community.

Tim Trott on "Get attachment id within wp_generate_attachment_metadata filter"

$
0
0

I'm trying to amend image attachment meta on upload by hooking into the wp_generate_attachment_metadata filter:

add_filter('wp_generate_attachment_metadata','updateExif_uploaded_image');

function updateExif_uploaded_image($image_data)
{
  // do stuff ...
  wp_update_attachment_metadata( $attachment_id, $image_data);
  return $image_data;
}

While "do stuff" works, I'm having trouble actually updating/saving the meta data as from what I can see, the attachment id is not passed into this function.

From /wp-admin/includes/image.php I can see that the ID is passed as a parameter but how do I get that from my function?

I tried function updateExif_uploaded_image($image_data, $attachment_id) but this caused an error with incorrect number of parameters.

Thanks in advance

gp_ranftd on "Having issues with $_POST data"

$
0
0

Hi,

we at our company have issues with our license management plugin that uses its own login. We updated to 4.4 yesterday and since then we encounter this strange behavior:
When logging in from the default language site (we use WPML) WP redirects the POST request with a 302 to the same URI but my login script will not receive the POST data. When using another language it works fine. The variable names are the same.

Has anyone an idea why this happens?

Best regards,
Daniel

Viewing all 8245 articles
Browse latest View live




Latest Images