New answers tagged

1

You can find documentation for the various packages in the Gutenberg Github repo in the readme for each package. For example, the "data" module docs are here: https://github.com/WordPress/gutenberg/tree/master/packages/data I will search a term in the Gutenberg repo, and show just the Markdown files to quickly find any related documentation. As far as ...


0

Currently, you have your variable defined below the include which would be too late. If you defined the variable above the include it should be accessible by whatever file is included. $hssHeading = "A new different Title"; include( locate_template( 'cp/heroSectionSmall.php', false, false ) ); <!-- heroSectionSmall.php --> echo $hssHeading; Maybe a ...


0

Full Disclosure: I am an author of the WPAdverts Classifieds Plugin for WordPress, but i will do my best to objectively explain differences between classifieds themes and plugins and what to look for when building a website for a client. When thinking of building a classifieds website on top of WordPress you need to first decide if you want to use a ...


0

The way you've 'deployed' this is very unconventional. You should have just set your post page to be the 'News' page. However, to answer your question. In appearance > menus > select menu you would like to edit, you can use something known as custom links, in which you can then add the same title as your www.xyz.com site, with the link from www.xyz.com over ...


0

I would think that you would need to give the user the ability to create posts/pages and save customizer settings to really get a feel of the theme. I would create a new "admin" user role that has all the permissions of an admin, except creating/deleting users. This way you can't get locked out of your site. Then i would create a function by hooking into ...


0

I finally found the problem, in fact when you add pagination to visual composer post-grid shortcode, it will use ajax to load the things. But to communicate to the ajax php script it uses the post id. The problem is that the shortcode will have no post id if you create it live, or another post id if you use an external post as a model. Then to make it ...


-1

use shortcode inside single quotes as: do_shortcode('[my_short_code]');


1

1st variant. CEO should add xyz.org with proper IP to the hosts file on his computer. This will work on the local machine. However, if it is a laptop, and sometimes the same laptop will be used in intranet, you need another solution. 2nd variant. In hosts file, point abc.org to outer IP. On site, install plugin Multiple Domains and setup it to work with ...


0

(In hurry? Skip to the bottom for the code..) So Gutenberg or the Block Editor uses the WordPress REST API when retrieving entity (e.g. postType>post and taxonomy>category) records (e.g. posts and terms). For examples, for posts (post type of post), the route is /wp/v2/posts. And for custom post types such as team, the default route is /wp/v2/team &...


2

When you save a selected page in the Customiser you're just saving the post ID of the page, which means you can just pass that value to any function that accepts a post ID as a parameter: $mytheme_f_page[1] = get_theme_mod( 'mytheme_featured_page_1' ); echo get_the_title( $mytheme_f_page[1] ); echo get_the_excerpt( $mytheme_f_page[1] ); echo ...


1

You can use gulp zip to do that. Take a look here https://www.npmjs.com/package/gulp-zip. This will let you zip up your theme with a terminal command and you can ignore whichever folders you want.


2

Neither. Hooked functions don’t need to be pluggable because child themes can already unhook and replace them with remove_action(). The main functions that you’d want to make pluggable are functions that are used in templates i.e. template tags, and those functions aren’t usually hooked, so the placement of add_action() isn’t relevant. Even then you ...


-2

Try with outside if function overridable_function() { echo 'Test'; } add_action( 'init', 'overridable_function' );


0

Underscores is primarily built so that you put your styles in style.css. This stylesheet is compiled from the main SASS file at sass/style.scss. Additionally, woocommerce.css is compiled from sass/woocommerce.scss. If you want to take advantage of SASS yourself, you can either add your styles to sass/style.scss, or import a file into it that has your styles....


1

As suggested by the default link labels, "Older Entries" and "Newer Entries", get_next_posts_link() and get_next_posts_link() are for outputting links between pages of posts. If you only have 2 posts, and your posts per page setting is set to anything higher than 1, then you're not going to have more than one page of any archive or your blog, so the links ...


0

Put the code block with all the prev/next links code inside the loop. The get_previous_posts_link() function relies on the current post ID, and outside of the loop that post ID is not available.


1

This sounds like a timing issue, there is probably already some JS running after your script is ran. Try wrapping your JS in $(window).load(), this will run the function after other page assets have loaded and should fix the timing issue. For example... $(window).load(function() { document.getElementById('user_pass').focus(); }); Here is some info ...


1

Just for anyone else that's looking for solutions. I found this, which I find much clearer than the accepted answer. Plus it gives simple ways to change the URL on the link as well! Just a little more detailed than the accepted answer. add_filter( 'get_custom_logo', 'add_custom_logo_url' ); function add_custom_logo_url() { $custom_logo_id = ...


1

If you are looking for specific term objects from the term slugs, from a specific taxonomy, I think new WP_Term_Query() is your best bet: $term_args = array( 'taxonomy' => 'category', 'name' => array( 'accessibility','wcag', 'abc' ) 'hide_empty' => false, 'fields' => 'all', 'count' => true, ); $term_query = new WP_Term_Query($...


0

Your header.php file is going to be called after the init action. If you want the logic to run in your header.php file first, maybe you can hook into another action done at a later point in WordPress: add_action('wp_head', 'ax_get_user_info'); function avox_get_user_info() { if (is_user_logged_in()) { $currentUser = wp_get_current_user(); ...


Top 50 recent answers are included